CVE-2023-39318
MEDIUM 6.1CVSS 3.1Improper 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.
- Published
- 8 Sep 2023
- Last modified
- 17 Jun 2026
- Assigned by
- security@golang.org
- NVD status
- Modified
- Weakness
- CWE-79
- Also known as
- BIT-golang-2023-39318GO-2023-2041
- Sources
- NVDJSONOSV GO-2023-2041JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | golang | gocpe:2.3:a:golang:go:*:*:*:*:*:*:*:* |
< 1.20.8 | 1.20.8 |
| NVD | golang | gocpe:2.3:a:golang:go:*:*:*:*:*:*:*:* |
>= 1.21.0, < 1.21.1 | 1.21.1 |
| OSV | Go | stdlib | < 1.20.8; >= 1.21.0-0, < 1.21.1 | 1.20.8, 1.21.1 |
References
- https://go.dev/cl/526156 · Patch, FIX
- https://go.dev/issue/62196 · Issue Tracking, REPORT
- https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ · Mailing List, Release Notes, WEB
- https://pkg.go.dev/vuln/GO-2023-2041 · Vendor Advisory
- https://security.gentoo.org/glsa/202311-09
- https://security.netapp.com/advisory/ntap-20231020-0009/ · Third Party Advisory
History
- 25 Nov 2026 20:36 UTC · NVD: first stored (published 8 Sep 2023)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 7 Sep 2023)