GO-2024-2610

Source
https://pkg.go.dev/vuln/GO-2024-2610
Import Source
https://vuln.go.dev/ID/GO-2024-2610.json
JSON Data
https://api.osv.dev/v1/vulns/GO-2024-2610
Aliases
Published
2024-03-05T22:15:40Z
Modified
2024-10-22T05:29:02.767625Z
Summary
Errors returned from JSON marshaling may break template escaping in html/template
Details

If errors returned from MarshalJSON methods contain user controlled data, they may be used to break the contextual auto-escaping behavior of the html/template package, allowing for subsequent actions to inject unexpected content into templates.

References
Credits
    • RyotaK (https://ryotak.net)

Affected packages

Go / stdlib

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.21.8
Introduced
1.22.0-0
Fixed
1.22.1

Ecosystem specific

{
    "imports": [
        {
            "path": "html/template",
            "symbols": [
                "Template.Execute",
                "Template.ExecuteTemplate",
                "escaper.commit",
                "jsValEscaper"
            ]
        }
    ]
}