CVE-2024-24785
JSON

5.4medium

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

Severity
5.4medium CVSS:3.1 by CISA-ADP
Exploit likelihood
0.79% (higher than 57% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Go
Also known as
GO-2024-2610BIT-GOLANG-2024-24785

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.

Affected

Product or packageVersionsReported by
html/templatebefore 1.21.8, from 1.22.0-0 before 1.22.1CVE List
stdlib (Go)before 1.21.8, from 1.22.0-0 before 1.22.1Go Vulnerability Database
golang (Bitnami)before 1.21.8, from 1.22.0-0 before 1.22.1Bitnami Vulnerability Database

All scores

CISA-ADP5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Bitnami Vulnerability Databasemedium rating

Classification

CWE-150

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

Si los errores devueltos por los métodos MarshalJSON contienen datos controlados por el usuario, se pueden usar para romper el comportamiento de escape automático contextual del paquete html/template, permitiendo acciones posteriores para inyectar contenido inesperado en las plantillas.

References

Related

Sources

SourceRecordLicence
CVE ListCVE-2024-24785 changed 2025-03-14CVE Terms of Use
Go Vulnerability DatabaseGO-2024-2610 changed 2026-02-04CC-BY-4.0
NVDCVE-2024-24785 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-GOLANG-2024-24785 changed 2026-01-28Apache-2.0