{"id":"CVE-2023-39318","aliases":["CVE-2023-39318","GO-2023-2041","BIT-GOLANG-2023-39318"],"related":["CGA-924c-64fp-86w2"],"kind":"vulnerability","state":"published","title":"Improper handling of HTML-like comments in script contexts in html/template","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"El paquete html/template no maneja correctamente los tokens de comentario \"\" similares a HTML, ni los tokens de comentario hashbang \"#!\", en el contexto","source":"nvd"}],"published":"2023-09-07T16:11:17.000Z","modified":"2026-09-08T08:47:48.441Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"1.20.8","status":"affected"},{"type":"semver","introduced":"1.21.0-0","fixed":"1.21.1","status":"affected"}],"vendor":"Go standard library","product":"html/template","package":"html/template","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.20.8"},{"type":"semver","introduced":"1.21.0-0","status":"affected","fixed":"1.21.1"}],"ecosystem":"Go","package":"stdlib","purl":"pkg:golang/stdlib","source":"go"},{"ranges":[{"status":"affected","fixed":"1.20.8"},{"status":"affected","introduced":"1.21.0","fixed":"1.21.1"}],"vendor":"golang","product":"go","cpe":"cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.20.8"},{"type":"semver","introduced":"1.21.0","status":"affected","fixed":"1.21.1"}],"ecosystem":"Bitnami","package":"golang","purl":"pkg:bitnami/golang","source":"bitnami"}],"references":[{"url":"https://go.dev/issue/62196","tags":["issue-tracking","report","x-transferred"],"sources":["cvelist","go","nvd","bitnami"]},{"url":"https://go.dev/cl/526156","tags":["fix","patch","x-transferred"],"sources":["cvelist","go","nvd","bitnami"]},{"url":"https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ","tags":["discussion","mailing-list","release-notes","web","x-transferred"],"sources":["cvelist","go","nvd","bitnami"]},{"url":"https://pkg.go.dev/vuln/GO-2023-2041","tags":["advisory","vendor-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://security.netapp.com/advisory/ntap-20231020-0009/","tags":["advisory","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://security.gentoo.org/glsa/202311-09","tags":["web","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-39318","tags":["web"],"sources":["bitnami"]}],"credits":["Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.)"],"assigner":"Go","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-09-26T16:02:51.219Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-39318","url":"https://www.cve.org/CVERecord?id=CVE-2023-39318","licence":"CVE Terms of Use","modified":"2025-02-13T17:02:46.777Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2023-2041","url":"https://pkg.go.dev/vuln/GO-2023-2041","licence":"CC-BY-4.0","modified":"2026-02-04T04:25:22.510Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-39318","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-39318","licence":"Public domain","modified":"2026-06-17T06:12:01.240Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-GOLANG-2023-39318","url":"https://osv.dev/vulnerability/BIT-GOLANG-2023-39318","licence":"Apache-2.0","modified":"2026-09-08T08:47:48.441Z"}],"updatedAt":"2026-11-25T22:58:27.765Z","epss":{"score":0.0093,"percentile":0.61629,"date":"2026-12-01T12:00:22.000Z"}}