Skip to content
Noroxi
CVE-2023-39318· NVD / CVE Program· CNA Go

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

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.

MediumCVSS 6.1 · v3.1—No exploit Fix available
Published
Sep 8, 2023
Updated
Jun 17, 2026
EPSS
0.9% · 59th percentile
Follow this CVE

Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.

Report tools

JSON

Action score

24

Monitor

Low priority for now.

CVSS
24 / 40 · 6.1 / 10
CISA KEV
0 / 30 · Not listed
EPSS
0 / 30 · 0.9%

CISA SSVC decision

Exploitation
none
Automatable
no
Technical impact
partial

Vulnrichment: CISA's decision-tree inputs.

Noroxi analysis

No Noroxi analysis for this record yet

We don't hand-write analysis for the hundreds of thousands of vulnerabilities in the database; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.

We use this product, ask for help

Affected systems

VendorProduct
golanggo

Affected versions

NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.

  • golang gobefore 1.20.8
  • golang go1.21.0 and later · before 1.21.1

Versions reported by the vendor

Affected version ranges reported by the assigning authority (Go). Independent of NVD's CPE analysis and usually ahead of it.

  • Go standard library html/template

    • before 1.20.8affected · semver
    • 1.21.0-0 and later · before 1.21.1affected · semver

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
AlmaLinux:8aardvark-dnsbefore 2:1.0.1-38.module_el8.9.0+3627+db8ec1552:1.0.1-38.module_el8.9.0+3627+db8ec155
AlmaLinux:8buildahbefore 1:1.24.6-7.module_el8.9.0+3627+db8ec1551:1.24.6-7.module_el8.9.0+3627+db8ec155
AlmaLinux:8buildah-testsbefore 1:1.24.6-7.module_el8.9.0+3687+dcd7ef8f1:1.24.6-7.module_el8.9.0+3687+dcd7ef8f
AlmaLinux:8buildah-testsbefore 1:1.24.6-7.module_el8.9.0+3627+db8ec1551:1.24.6-7.module_el8.9.0+3627+db8ec155
AlmaLinux:8cockpit-podmanbefore 46-1.module_el8.7.0+3344+5bcd850f46-1.module_el8.7.0+3344+5bcd850f
AlmaLinux:8conmonbefore 2:2.1.4-2.module_el8.9.0+3687+dcd7ef8f2:2.1.4-2.module_el8.9.0+3687+dcd7ef8f
AlmaLinux:8conmonbefore 2:2.1.4-2.module_el8.9.0+3627+db8ec1552:2.1.4-2.module_el8.9.0+3627+db8ec155
AlmaLinux:8container-selinuxbefore 2:2.205.0-3.module_el8.9.0+3627+db8ec1552:2.205.0-3.module_el8.9.0+3627+db8ec155
AlmaLinux:8containernetworking-pluginsbefore 1:1.1.1-6.module_el8.9.0+3711+04fcca5e1:1.1.1-6.module_el8.9.0+3711+04fcca5e
AlmaLinux:8containers-commonbefore 2:1-38.module_el8.9.0+3627+db8ec1552:1-38.module_el8.9.0+3627+db8ec155
AlmaLinux:8critbefore 3.15-3.module_el8.6.0+2877+8e437bf53.15-3.module_el8.6.0+2877+8e437bf5
AlmaLinux:8critbefore 3.15-3.module_el8.6.0+3137+d33c3efb3.15-3.module_el8.6.0+3137+d33c3efb
AlmaLinux:8criubefore 3.15-3.module_el8.6.0+2877+8e437bf53.15-3.module_el8.6.0+2877+8e437bf5
AlmaLinux:8criubefore 3.15-3.module_el8.6.0+3137+d33c3efb3.15-3.module_el8.6.0+3137+d33c3efb
AlmaLinux:8criu-develbefore 3.15-3.module_el8.6.0+3137+d33c3efb3.15-3.module_el8.6.0+3137+d33c3efb
AlmaLinux:8criu-develbefore 3.15-3.module_el8.6.0+2877+8e437bf53.15-3.module_el8.6.0+2877+8e437bf5
AlmaLinux:8criu-libsbefore 3.15-3.module_el8.6.0+3137+d33c3efb3.15-3.module_el8.6.0+3137+d33c3efb
AlmaLinux:8criu-libsbefore 3.15-3.module_el8.6.0+2877+8e437bf53.15-3.module_el8.6.0+2877+8e437bf5
AlmaLinux:8crunbefore 1.8.7-1.module_el8.9.0+3683+33eb0feb1.8.7-1.module_el8.9.0+3683+33eb0feb
AlmaLinux:8fuse-overlayfsbefore 1.9-2.module_el8.9.0+3627+db8ec1551.9-2.module_el8.9.0+3627+db8ec155
AlmaLinux:8libslirpbefore 4.4.0-1.module_el8.6.0+2877+8e437bf54.4.0-1.module_el8.6.0+2877+8e437bf5
AlmaLinux:8libslirpbefore 4.4.0-1.module_el8.6.0+3137+d33c3efb4.4.0-1.module_el8.6.0+3137+d33c3efb
AlmaLinux:8libslirp-develbefore 4.4.0-1.module_el8.6.0+2877+8e437bf54.4.0-1.module_el8.6.0+2877+8e437bf5
AlmaLinux:8libslirp-develbefore 4.4.0-1.module_el8.6.0+3137+d33c3efb4.4.0-1.module_el8.6.0+3137+d33c3efb

+96

Other highest-scoring records for the same primary product.

  • CVE-2018-7187The "go get" implementation in Go 1.9.4, when the -insecure command-line option is used, does not validate the import path (get/vcs.go only
    54Plan
  • CVE-2018-16873In Go before 1.10.6 and 1.11.x before 1.11.3, the "go get" command is vulnerable to remote code execution when executed with the -u flag and
    52Plan
  • CVE-2021-38297Go before 1.16.9 and 1.17.x before 1.17.2 has a Buffer Overflow via large arguments in a function invocation from a WASM module, when GOARCH
    42Plan
  • CVE-2019-14809net/url in Go before 1.11.13 and 1.12.x before 1.12.8 mishandles malformed hosts in URLs, leading to an authorization bypass in some applica
    42Plan
  • CVE-2015-5739The net/http library in net/textproto/reader.go in Go before 1.4.3 does not properly parse HTTP header keys, which allows remote attackers t
    42Plan
  • CVE-2017-15041Go before 1.8.4 and 1.9.x before 1.9.1 allows "go get" remote command execution.
    42Plan

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
Go standard library html/template1.20.8Vendor (CNA)
Go standard library html/template1.21.1Vendor (CNA)
almalinux:aardvark-dns2:1.0.1-38.module_el8.9.0+3627+db8ec155 · AlmaLinux:8Package registry (OSV)
almalinux:buildah1:1.31.3-2.el9_3 · AlmaLinux:9Package registry (OSV)
almalinux:buildah-tests1:1.31.3-2.el9_3 · AlmaLinux:9Package registry (OSV)
almalinux:containernetworking-plugins1:1.3.0-6.el9_3 · AlmaLinux:9Package registry (OSV)
almalinux:podman2:4.6.1-7.el9_3 · AlmaLinux:9Package registry (OSV)
almalinux:podman-docker2:4.6.1-7.el9_3 · AlmaLinux:9Package registry (OSV)
almalinux:podman-gvproxy2:4.6.1-7.el9_3 · AlmaLinux:9Package registry (OSV)
almalinux:podman-plugins2:4.6.1-7.el9_3 · AlmaLinux:9Package registry (OSV)
almalinux:podman-remote2:4.6.1-7.el9_3 · AlmaLinux:9Package registry (OSV)
almalinux:podman-tests2:4.6.1-7.el9_3 · AlmaLinux:9Package registry (OSV)
almalinux:skopeo2:1.13.3-3.el9_3 · AlmaLinux:9Package registry (OSV)
almalinux:skopeo-tests2:1.13.3-3.el9_3 · AlmaLinux:9Package registry (OSV)
Go:stdlib1.20.8Package registry (OSV)
Go:stdlib1.21.1Package registry (OSV)
opensuse:go1.201.20.8-150000.1.23.1 · openSUSE:Leap 15.4Package registry (OSV)
opensuse:go1.20-openssl1.20.8.1-150000.1.11.1 · openSUSE:Leap 15.4Package registry (OSV)
opensuse:go1.211.21.1-150000.1.6.1 · openSUSE:Leap 15.4Package registry (OSV)
opensuse:go1.21-openssl1.21.4.1-150000.1.5.1 · openSUSE:Leap 15.4Package registry (OSV)
red hat:delve0:1.20.2-1.module+el8.9.0+18926+5193682d · Red Hat:enterprise_linux:8::appstreamPackage registry (OSV)
red hat:delve-debuginfo0:1.20.2-1.module+el8.9.0+18926+5193682d · Red Hat:enterprise_linux:8::appstreamPackage registry (OSV)
red hat:delve-debugsource0:1.20.2-1.module+el8.9.0+18926+5193682d · Red Hat:enterprise_linux:8::appstreamPackage registry (OSV)
red hat:go-toolset0:1.20.10-1.el9_3 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:golang0:1.20.10-1.el9_3 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:golang-bin0:1.20.10-1.el9_3 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:golang-docs0:1.20.10-1.el9_3 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:golang-misc0:1.20.10-1.el9_3 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:golang-src0:1.20.10-1.el9_3 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)
red hat:golang-tests0:1.20.10-1.el9_3 · Red Hat:enterprise_linux:9::appstreamPackage registry (OSV)

+19

Exploit status

No known public exploit

No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

No dated events beyond publication.

EPSS, last 120 days

FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).

Patch and commit links

Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.

No commit or PR link among the references.

Finders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.

Variant candidates

Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.

No nightly-computed relations.

Chain candidates

An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.

—

Bug bounty scope

No known public program.

Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).

National notice (Türkiye Cybersecurity Directorate / USOM)

Official security notices citing this record; remediation advice is on the agency's page.

All national notices →

Technical details

Attack conditions

  • Anyone who can reach it over the internet can trigger it.
  • No account or password is required.
  • A user must open a link or visit a page.
  • No special conditions are required; it is repeatable.

If successful

Confidentiality
low · data can be read
Integrity
low · data or configuration can be modified
Availability
none

Impact can extend beyond the vulnerable component (scope changes).

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality impact
Low
Integrity impact
Low
Availability impact
None

CVSS vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

nvd-primary

Root cause

User content is inserted into the page as HTML. The browser interprets the content as code rather than data.

A representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.

Vulnerable

ts
commentEl.innerHTML = comment.body;

Fixed

ts
commentEl.textContent = comment.body;

Change log

  1. Fix✗ → ✓

For records you follow, these changes also arrive as notifications. →

References

All records