CVE-2023-24539: Improper sanitization of CSS values in golang/stdlib
Summary
CVE-2023-24539: Angle brackets () are not considered dangerous characters when inserted into CSS contexts. Affects golang-1.15 versions < 484330d038d060c6e4db3dc8e6ea2b811b2a44d8. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The golang/stdlib package is a standard library for the Go programming language. It provides a wide range of functionality, including support for HTML templates. The vulnerability in question arises from improper sanitization of CSS values within the html/template package. Specifically, angle brackets (<>) are not considered dangerous characters when inserted into CSS contexts. Templates containing multiple actions separated by a '/' character can result in unexpectedly closing the CSS context and allowing for injection of unexpected HTML, if executed with untrusted input.
Vulnerability Detail
The vulnerability allows for the injection of unexpected HTML when executing templates with untrusted input. This can lead to various security issues, such as cross-site scripting (XSS) attacks. By injecting malicious HTML code, an attacker can potentially execute arbitrary scripts or steal sensitive information from users. The vulnerability has a CVSS score of 7.3, indicating a high severity level.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
There is no specific workaround mentioned for this vulnerability.
Conclusion
The golang/stdlib package is vulnerable to an improper sanitization of CSS values, which can lead to the injection of unexpected HTML and potential security risks. It is crucial to update the package to the fixed versions (1.19.9 or 1.20.4) to mitigate this vulnerability. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for golang-1.15 →
FAQ
The vulnerability allows for the injection of unexpected HTML, which can lead to security issues such as cross-site scripting (XSS) attacks.
You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply upload your manifest file (e.g., package-lock.json) and Vulert will analyze it for open-source vulnerabilities in real-time.
There are no known exploits for this vulnerability at the moment. However, it is important to address the vulnerability promptly to mitigate any potential risks.
The recommended approach is to update the golang/stdlib package to the fixed versions. However, if updating is not feasible in the short term, you can consider implementing additional input validation and sanitization measures to mitigate the risk.
You can find more information about this vulnerability in the National Vulnerability Database (NVD) entry: https://nvd.nist.gov/vuln/detail/CVE-2023-24539
Related vulnerabilities
Recent vulnerabilities recorded for golang-1.15.