CVE-2023-24539: Improper sanitization of CSS values in golang/stdlib

golang-1.15 Updated 02 Oct 2025

Summary

11/05/2023
N/A
No i
High
7.3

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 ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 →

Share this vulnerability

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.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback