GO-2023-2043

Source
https://pkg.go.dev/vuln/GO-2023-2043
Import Source
https://vuln.go.dev/ID/GO-2023-2043.json
JSON Data
https://api.osv.dev/v1/vulns/GO-2023-2043
Aliases
Published
2023-09-07T16:11:59Z
Modified
2024-05-20T16:03:47Z
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.

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",
                "indexTagEnd",
                "tSpecialTagEnd"
            ]
        }
    ]
}