{"schema_version":"1.7.3","id":"GO-2023-2041","published":"2023-09-07T16:11:17Z","modified":"2026-02-04T04:25:22.510281Z","aliases":["BIT-golang-2023-39318","CVE-2023-39318"],"related":["CGA-924c-64fp-86w2"],"summary":"Improper handling of HTML-like comments in script contexts in html/template","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.","affected":[{"package":{"name":"stdlib","ecosystem":"Go","purl":"pkg:golang/stdlib"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.20.8"},{"introduced":"1.21.0-0"},{"fixed":"1.21.1"}]}],"ecosystem_specific":{"imports":[{"path":"html/template","symbols":["Template.Execute","Template.ExecuteTemplate","escaper.escapeText","isComment","tJS","tLineCmt"]}]},"database_specific":{"source":"https://vuln.go.dev/ID/GO-2023-2041.json"}}],"references":[{"type":"REPORT","url":"https://go.dev/issue/62196"},{"type":"FIX","url":"https://go.dev/cl/526156"},{"type":"WEB","url":"https://groups.google.com/g/golang-dev/c/2C5vbR-UNkI/m/L1hdrPhfBAAJ"}],"database_specific":{"review_status":"REVIEWED","url":"https://pkg.go.dev/vuln/GO-2023-2041"},"credits":[{"name":"Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.)"}]}