CVE-2023-24538: JavaScript code injection in Go html/template backtick handling
- Vendor
- Golang
CVE-2023-24538 is a code-injection vulnerability in Go's html/template package. Its contextual escaping does not correctly recognize backticks as JavaScript string delimiters for ES6 template literals. When a Go template action appears inside a JavaScript template literal, attacker-controlled action data can terminate the literal and inject arbitrary JavaScript into the rendered output. The corrective change rejects Go template actions inside JavaScript template literals, producing an error with ErrorCode 12.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation can cause attacker-supplied JavaScript to execute when the rendered output is evaluated, enabling cross-site scripting in web applications. Depending on the application's security context, this can expose data accessible to scripts and permit unauthorized actions or modification of displayed content. The template-escaping flaw alone does not establish native code execution on the Go server.
Mitigation
If you can’t patch tonight, do this now.
Remove Go template actions from JavaScript template literals or disable the affected rendering functionality until patched applications can be deployed. Do not rely on ad hoc backtick filtering because JavaScript template literals also support interpolation and complex syntax. Red Hat identifies no general mitigation meeting its product-security criteria for usability, deployability, applicability, and stability.
Remediation
Patch, then assume compromise.
Apply a Go security update or vendor backport addressing CVE-2023-24538, then rebuild and redeploy affected Go applications. For packaged products or containerized applications, install the corresponding vendor-fixed packages or images. Refactor templates that place Go actions inside JavaScript template literals because the corrective change rejects that construction. Avoid enabling the GODEBUG compatibility setting jstmpllitinterp=1: it restores interpolation with backtick escaping and is explicitly cautioned against as a compatibility measure rather than the preferred secure behavior.
Exploits
No public exploits tracked yet. Mallory keeps watching.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2023-24538 exploited in the wild?
- As of Nov 24, 2026, Mallory has no reports of CVE-2023-24538 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2023-24538?
- As of Nov 24, 2026, Mallory has found no public exploit for CVE-2023-24538.
- Is there a patch for CVE-2023-24538?
- Apply a Go security update or vendor backport addressing CVE-2023-24538, then rebuild and redeploy affected Go applications. For packaged products or containerized applications, install the corresponding vendor-fixed packages or images.
- What products are affected by CVE-2023-24538?
- Golang Go.
- How severe is CVE-2023-24538?
- CVE-2023-24538 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 2.4% (85th percentile) as of Nov 24, 2026.
Recent activity
42 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.