Go Vulnerability Database
GO-2024-2610
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.
Affected packages
| Ecosystem | Package | Affected versions |
|---|---|---|
| Go | stdlib | All versions before 1.21.8 (fixed in 1.21.8) From 1.22.0-0 before 1.22.1 (fixed in 1.22.1) |