CVE-2023-39318
JSON

6.1medium

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

Severity
6.1medium CVSS:3.1 by NVD
Exploit likelihood
0.93% (higher than 61% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Go
Also known as
GO-2023-2041BIT-GOLANG-2023-39318

Description

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.

Affected

Product or packageVersionsReported by
html/templatebefore 1.20.8, from 1.21.0-0 before 1.21.1CVE List
stdlib (Go)before 1.20.8, from 1.21.0-0 before 1.21.1Go Vulnerability Database
golang gobefore 1.20.8, from 1.21.0 before 1.21.1NVD
golang (Bitnami)before 1.20.8, from 1.21.0 before 1.21.1Bitnami Vulnerability Database

All scores

NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Bitnami Vulnerability Databasemedium rating

Classification

CWE-79

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

El paquete html/template no maneja correctamente los tokens de comentario "" similares a HTML, ni los tokens de comentario hashbang "#!", en el contexto

References

Related

Sources

SourceRecordLicence
CVE ListCVE-2023-39318 changed 2025-02-13CVE Terms of Use
Go Vulnerability DatabaseGO-2023-2041 changed 2026-02-04CC-BY-4.0
NVDCVE-2023-39318 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-GOLANG-2023-39318 changed 2026-09-08Apache-2.0