CVE-2023-39318: The html/template package does not properly handle HTML-like "" comment tokens, nor hashbang "#!" comment tokens, in <script> contexts.
Medium CVSS 6.1
- CVE id
- CVE-2023-39318
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| Go Runtimes and servers |
< 1.20.8 >= 1.21.0, < 1.21.1 |
1.20.8, 1.21.1 |
How to fix it
Upgrade Go to the fixed release of the line you run: 1.20.8, 1.21.1.
go version
- Build with the patched Go release (set "toolchain" in go.mod, or the golang image tag) and redeploy: Go programs include the standard library, so they must be rebuilt.
A free AIssue account reads the runtime versions your repositories pin (version files, Dockerfiles, build files) and tells you when one is affected.
Details
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.
References
- CVE-2023-39318 on the NVD
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2023-39318
- Web: https://go.dev/cl/526156
- Web: https://go.dev/issue/62196
- Web: https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ
- Web: https://pkg.go.dev/vuln/GO-2023-2041
- Web: https://security.gentoo.org/glsa/202311-09
- Web: https://security.netapp.com/advisory/ntap-20231020-0009/
- Web: https://go.dev/cl/526156
- Web: https://go.dev/issue/62196
- Web: https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ
- Web: https://pkg.go.dev/vuln/GO-2023-2041
- Web: https://security.gentoo.org/glsa/202311-09
- Web: https://security.netapp.com/advisory/ntap-20231020-0009/
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: National Vulnerability Database (NVD) (public domain). Severity comes from the advisory's own rating when it has one, else from its CVSS score.