{"schema_version":"1.7.3","id":"GO-2023-2043","published":"2023-09-07T16:11:59Z","modified":"2026-02-04T04:11:02.549923Z","aliases":["BIT-golang-2023-39319","CVE-2023-39319"],"related":["CGA-4gc6-fx2r-v7r7"],"summary":"Improper handling of special tags within script contexts in html/template","details":"The html/template package does not apply the proper rules for handling occurrences of \"<script\", \"<!--\", and \"</script\" within JS literals in <script> contexts. This may cause the template parser to improperly consider script contexts to be terminated early, causing actions to be improperly escaped. This could 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","indexTagEnd","tSpecialTagEnd"]}]},"database_specific":{"source":"https://vuln.go.dev/ID/GO-2023-2043.json"}}],"references":[{"type":"REPORT","url":"https://go.dev/issue/62197"},{"type":"FIX","url":"https://go.dev/cl/526157"},{"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-2043"},"credits":[{"name":"Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.)"}]}