CVE-2024-24785

Errors returned from JSON marshaling may break template escaping in html/template

State
Published
Severity
5.4 Medium
Published
Mar 5, 2024
Updated
Mar 14, 2025
Reserved
Jan 30, 2024

Read the record on cve.org

Description

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.

Scores

CVSSScoreVectorSource
3.15.4 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:NCISA-ADP

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
html/templateGo standard library
  • before 1.21.8Affected
  • 1.22.0-0 to before 1.22.1Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.