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 package | Versions | Reported by |
|---|---|---|
| html/template | before 1.20.8, from 1.21.0-0 before 1.21.1 | CVE List |
| stdlib (Go) | before 1.20.8, from 1.21.0-0 before 1.21.1 | Go Vulnerability Database |
| golang go | before 1.20.8, from 1.21.0 before 1.21.1 | NVD |
| golang (Bitnami) | before 1.20.8, from 1.21.0 before 1.21.1 | Bitnami Vulnerability Database |
All scores
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| Bitnami Vulnerability Database | medium rating |
Classification
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
| https://go.dev/issue/62196 | issue-tracking, report | |
| https://go.dev/cl/526156 | fix, patch | |
| https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ | discussion, mailing-list, release-notes, web | |
| https://pkg.go.dev/vuln/GO-2023-2041 | advisory, vendor-advisory | |
| https://security.netapp.com/advisory/ntap-20231020-0009/ | advisory, third-party-advisory | |
| https://security.gentoo.org/glsa/202311-09 | web | |
| https://nvd.nist.gov/vuln/detail/CVE-2023-39318 | web | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-39318 changed 2025-02-13 | CVE Terms of Use |
| Go Vulnerability Database | GO-2023-2041 changed 2026-02-04 | CC-BY-4.0 |
| NVD | CVE-2023-39318 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-GOLANG-2023-39318 changed 2026-09-08 | Apache-2.0 |