CVE-2023-39319
JSON

6.1medium

Improper handling of special tags within script contexts in html/template

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

Description

The html/template package does not apply the proper rules for handling occurrences of "<script", "<!--", and "</script" within JS literals in <script> contexts. This may cause the template parser to improperly consider script contexts to be terminated early, causing actions to be improperly escaped. This could 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 apply the proper rules for handling occurrences of "<script", "<!--", and "</script" within JS literals in <script> contexts. This may cause the template parser to improperly consider script contexts to be terminated early, causing actions to be improperly escaped. This could be leveraged to perform an XSS attack.

NVD (es)

El paquete html/template no aplica las reglas adecuadas para controlar las ocurrencias de ". Esto puede hacer que el analizador de plantillas considere incorrectamente que los contextos de script se terminan antes de tiempo, lo que provoca que las acciones se escapen incorrectamente. Esto podría aprovecharse para realizar un ataque XSS.

References

Related

Sources

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