# CVE-2023-24538: Backticks not treated as string delimiters in html/template

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 2.37% (percentile 85, 2026-11-28)
- **CWE:** CWE-94
- **Aliases:** BIT-golang-2023-24538, GO-2023-1703
- **Published:** 2023-04-05T21:05:27.000Z
- **Modified:** 2026-06-17T05:39:29.670Z

## Who should check

- Projects that depend on Go package stdlib (\< 1.19.8; \>= 1.20.0-0, \< 1.20.3)
- Anyone running Go standard library html/template \< 1.19.8; \>= 1.20.0-0, \< 1.20.3

## Description

Templates do not properly consider backticks (\`) as Javascript string delimiters, and do not escape them as expected. Backticks are used, since ES6, for JS template literals. If a template contains a Go template action within a Javascript template literal, the contents of the action can be used to terminate the literal, injecting arbitrary Javascript code into the Go template. As ES6 template literals are rather complex, and themselves can do string interpolation, the decision was made to simply disallow Go template actions from being used inside of them (e.g. "var a = {{.}}"), since there is no obviously safe way to allow this behavior. This takes the same approach as github.com/google/safehtml. With fix, Template.Parse returns an Error when it encounters templates like this, with an ErrorCode of value 12. This ErrorCode is currently unexported, but will be exported in the release of Go 1.21. Users who rely on the previous behavior can re-enable it using the GODEBUG flag jstmpllitinterp=1, with the caveat that backticks will now be escaped. This should be used with caution.

## Affected and fixed versions

- Go `stdlib`: affected \< 1.19.8; \>= 1.20.0-0, \< 1.20.3; fixed 1.19.8, 1.20.3 (osv)
- Go standard library html/template: \< 1.19.8; \>= 1.20.0-0, \< 1.20.3 (cvelist)

## Mitigation

- Upgrade stdlib to one of 1.19.8, 1.20.3 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-24538. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-24538.md
Affected: stdlib < 1.19.8; >= 1.20.0-0, < 1.20.3
Fixed in: 1.19.8, 1.20.3

Steps:
1. Search this machine and project for stdlib (Go), Go standard library html/template: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-24538 being exploited?

There is no confirmed exploitation: CVE-2023-24538 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 2.37% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2023-24538?

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2023-24538?

stdlib \< 1.19.8; \>= 1.20.0-0, \< 1.20.3.

### Is there a fix for CVE-2023-24538?

Yes. Fixed in 1.19.8, 1.20.3. Upgrade stdlib to one of 1.19.8, 1.20.3 (or later in the same release line).

### How do I check if I'm affected by CVE-2023-24538?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://pkg.go.dev/vuln/GO-2023-1703>
- patch: <https://go.dev/issue/59234>
- patch: <https://go.dev/cl/482079>
- other: <https://groups.google.com/g/golang-announce/c/Xdv6JL9ENs8>
- other: <https://security.gentoo.org/glsa/202311-09>
- other: <https://security.netapp.com/advisory/ntap-20241115-0007/>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-24538>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GO-2023-1703> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2023-24538> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-24538>
