CWE
74 77
Advisory Published
CVE Published
Updated

CVE-2023-24540: Improper handling of JavaScript whitespace in html/template

First published: Sun May 07 2023(Updated: )

Go is vulnerable to HTML injection. A remote attacker could inject malicious HTML code into a template containing whitespace characters outside of the character set "\t\n\f\r\u0020\u2028\u2029", which when viewed, would execute in the victim's Web browser within the security context of the hosting site.

Credit: security@golang.org security@golang.org

Affected SoftwareAffected VersionHow to fix
redhat/golang<1.19.9
1.19.9
redhat/golang<1.20.4
1.20.4
debian/golang-1.15<=1.15.15-1~deb11u4
debian/golang-1.19<=1.19.8-2
IBM Concert Software<=1.0.0 - 1.0.1
Go<1.19.9
Go>=1.20.0<1.20.4

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Reference Links

Parent vulnerabilities

(Appears in the following advisories)

Frequently Asked Questions

  • What is CVE-2023-24540?

    CVE-2023-24540 is a vulnerability that affects JavaScript contexts with actions that may not properly sanitize templates containing whitespace characters outside of the character set \t\n\f\r\u0020\u2028\u2029 in the Go programming language.

  • How severe is CVE-2023-24540?

    CVE-2023-24540 has a severity rating of 9.8 (critical).

  • Which software packages are affected by CVE-2023-24540?

    The affected software packages are golang versions up to and excluding 1.19.9 and golang versions within the range 1.20.0 to 1.20.4.

  • How can I fix CVE-2023-24540?

    To fix CVE-2023-24540, update to golang version 1.19.9 or install a version within the range 1.20.0 to 1.20.4.

  • Where can I find more information about CVE-2023-24540?

    You can find more information about CVE-2023-24540 in the following references: 1. [Bugzilla - CVE-2023-24540](https://bugzilla.redhat.com/show_bug.cgi/show_bug.cgi?id=2196629) 2. [Bugzilla - CVE-2023-24540](https://bugzilla.redhat.com/show_bug.cgi/show_bug.cgi?id=2196630) 3. [Golang Announce - CVE-2023-24540](https://groups.google.com/g/golang-announce/c/MEb0UyuSMsU)

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203