VDB

CVE-2023-39318

CVE-2023-39318 PUBLISHED

Improper handling of HTML-like comments in script contexts in html/template

Reported by go · Published September 8, 2023

html/template is fixed in 1.21.1 and 1.20.8 (Go Modules)

The html/template package does not properly handle HTML-like "" comment tokens, nor hashbang "#!" comment tokens, in <script> contexts. This may cause the template parser to improperly interpret the contents of <script> contexts, causing actions to be improperly escaped. This may be leveraged to perform an XSS attack.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
html/templateGo Modules1.21.1, 1.20.8
stdlibGo Modules1.21.1, 1.20.8
golang-miscAmazon Linux1.20.10-1.amzn2.0.1, 1.20.8-1.amzn2023.0.1
golang-srcAmazon Linux1.20.10-1.amzn2.0.1, 1.20.8-1.amzn2023.0.1
golang-docsAmazon Linux1.20.10-1.amzn2.0.1, 1.20.8-1.amzn2023.0.1
kindChainguard0.21.0-r0
falcoWolfi0.37.1-r0
falcoChainguard0.37.1-r0
metrics-serverChainguard0.6.4-r1
goAlpine1.21.1-r0, 1.20.8-r0
golang-sharedAmazon Linux1.20.10-1.amzn2.0.1, 1.20.8-1.amzn2023.0.1
golang-binAmazon Linux1.20.10-1.amzn2.0.1, 1.20.8-1.amzn2023.0.1

9 more packages have a fixed version. See every fix in Lookup.

Affected products

VendorProductVersions
Go standard libraryhtml/template0, 1.21.0-0
amazon:2golang-misc0
amazon:2023golang-src0
amazon:2023golang-docs0
chainguardkind0
amazon:2golang-src0
wolfifalco0
amazon:2023golang-misc0
chainguardfalco0
amazon:2golang-docs0
chainguardmetrics-server0
Go standard libraryhtml/template1.21.0-0, 0
alpinego0, 0
amazon:2golang-shared0
amazon:2023golang-bin0
amazon:2golang-bin0
amazon:2023golang-shared0
amazon:2golang0
amazon:2023golang-tests0
wolfikubeflow-katib0, 0

…and 5 more

Timeline

  • Sep 6, 2023 CVE Published
  • Sep 9, 2023 EPSS Score (30 in total, the first dated here)
  • Feb 8, 2026 Security Advisory (34 in total, the first dated here)
  • Aug 5, 2026 Coalition ESS Score
  • Nov 11, 2026 Distribution Patch (31 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2023-39318
vulnetix vdb fixes CVE-2023-39318

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2023-39318/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

References

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›