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 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 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
| https://go.dev/issue/62197 | issue-tracking, report | |
| https://go.dev/cl/526157 | fix, patch | |
| https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ | article, release-notes, web | |
| https://pkg.go.dev/vuln/GO-2023-2043 | 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-39319 | web | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-39319 changed 2025-02-13 | CVE Terms of Use |
| Go Vulnerability Database | GO-2023-2043 changed 2026-02-04 | CC-BY-4.0 |
| NVD | CVE-2023-39319 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-GOLANG-2023-39319 changed 2026-09-08 | Apache-2.0 |