# CVE-2023-39318: Improper handling of HTML-like comments in script contexts in html/template

- Severity: Medium 6.1 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.93%, higher than 61% of CVEs (2026-12-01)
- Published: 2023-09-07T16:11:17.000Z
- Modified: 2026-09-08T08:47:48.441Z
- Also known as: GO-2023-2041, BIT-GOLANG-2023-39318
- Related: CGA-924c-64fp-86w2
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Go

## 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.

(As written by CVE List.)

## Affected

- html/template: before 1.20.8; from 1.21.0-0 before 1.21.1
- stdlib (Go): before 1.20.8; from 1.21.0-0 before 1.21.1
- golang go: before 1.20.8; from 1.21.0 before 1.21.1
- golang (Bitnami): before 1.20.8; from 1.21.0 before 1.21.1

## Every score

- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Bitnami Vulnerability Database: rating Medium

## 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)

## Sources

- CVE List: [CVE-2023-39318](https://www.cve.org/CVERecord?id=CVE-2023-39318), CVE Terms of Use, modified 2025-02-13
- Go Vulnerability Database: [GO-2023-2041](https://pkg.go.dev/vuln/GO-2023-2041), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2023-39318](https://nvd.nist.gov/vuln/detail/CVE-2023-39318), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-GOLANG-2023-39318](https://osv.dev/vulnerability/BIT-GOLANG-2023-39318), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2023-39318 · Whole record: https://cve.day/CVE-2023-39318.json · Rebuilt by cve.day 2026-11-25T22:58:27.765Z
