9.8

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

Modified
AliasesUBUNTU-CVE-2023-24538DEBIAN-CVE-2023-24538CGA-46px-45cg-f63w
Published 06-04-2023Last modified 13-02-2025

Vulnerability summary

CVE-2023-24538 is a critical (CVSS 9.8) Improper Control of Generation of Code vulnerability in go standard library html/template. EPSS estimates a 2.28% chance of exploitation in the next 30 days, higher than 83.1% of scored vulnerabilities.

Priority
Prioritisesevere

Severe, CVSS 9.8 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 2% (FIRST, 03-11-2026)

Source freshness unavailable

How is this decided?
CVSS score
9.8/10
010
Critical · v3.1 (CVE.org)
EPSS score
2.28%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits0No public exploits recorded

Advisory lineage

Upstream 0 · Downstream 31 · Related 15

Timeline

  1. 06-04-2023
    PublishedVulnerability first disclosed.
  2. 13-02-2025
    Last modifiedVulnerability information updated.

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.

CVSS metrics

7 scores · 7 sources · 1 version

EPSS trend

Probability

2.28%

Chance of exploitation in the next 30 days

Percentile

83%

Versus all other CVEs

30-day change

No change 0.00 pp

From 2.28% on 04-10-2026

04-10-202603-11-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.

Chainguard11 products
  • go-1.20< 1.20.3-r1
  • katib-earlystopping< 0.19.0-r31
  • katib-suggestion-goptuna-compatAll versions (No fix recorded)
  • katib-suggestion-hyperband< 0.19.0-r31
  • katib-suggestion-hyperopt< 0.19.0-r31 | < 0.19.0-r40
Wolfi11 products
  • go-1.20< 1.20.3-r1
  • katib-earlystopping< 0.19.0-r31
  • katib-suggestion-goptuna-compatAll versions (No fix recorded)
  • katib-suggestion-hyperband< 0.19.0-r31
  • katib-suggestion-hyperopt< 0.19.0-r31 | < 0.19.0-r40
Ubuntu9 products
  • golang-1.10All versions (No fix recorded)
  • golang-1.13< 1.13.8-1ubuntu1~16.04.3+esm3 | < 1.13.8-1ubuntu1~18.04.4+esm1 | < 1.13.8-1ubuntu1.2 | < 1.13.8-1ubuntu2.22.04.2
  • golang-1.14All versions (No fix recorded)
  • golang-1.16< 1.16.2-0ubuntu1~18.04.2+esm1 | < 1.16.2-0ubuntu1~20.04.1
  • golang-1.17< 1.17.13-3ubuntu1.2
Alpine1 product
  • go≥ 1.20.0, < 1.19.8-r0 | ≥ 1.20.0, < 1.20.3-r0
Debian1 product
  • golang-1.19< 1.19.8-2
Go1 product
  • stdlib≥ 1.20.0-0, < 1.20.3
Go standard library1 product
Golang1 product
  • go< 1.19.8 | ≥ 1.20.0, < 1.20.3

8 vendors · 36 products

References

19 links
Show all 19 references