CVE-2024-24785
golang: html/template: errors returned from MarshalJSON methods may break template escaping
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · March 5, 2024
Updated · November 1, 2026
Description
A flaw was found in Go's html/template standard library package. 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 subsequent actions to inject unexpected content into templates.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
Mitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.
CVSS / CWE
CVSS 3.1 · 6.5CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
CWE-74 · Improper Neutralization of Special Elements in Output Used by a Downstream Component