GO-2023-2041

Source
https://pkg.go.dev/vuln/GO-2023-2041
Import Source
https://vuln.go.dev/ID/GO-2023-2041.json
JSON Data
https://api.osv.dev/v1/vulns/GO-2023-2041
Aliases
Published
2023-09-07T16:11:17Z
Modified
2024-09-11T06:13:45.773207Z
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.

References
Credits
    • Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.)

Affected packages

Go / stdlib

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
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"
            ]
        }
    ]
}