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 package | Versions | Reported by |
|---|---|---|
| html/template | before 1.21.8, from 1.22.0-0 before 1.22.1 | CVE List |
| stdlib (Go) | before 1.21.8, from 1.22.0-0 before 1.22.1 | Go Vulnerability Database |
| golang (Bitnami) | before 1.21.8, from 1.22.0-0 before 1.22.1 | Bitnami Vulnerability Database |
All scores
| CISA-ADP | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N |
| Bitnami Vulnerability Database | medium rating |
Classification
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-24785 changed 2025-03-14 | CVE Terms of Use |
| Go Vulnerability Database | GO-2024-2610 changed 2026-02-04 | CC-BY-4.0 |
| NVD | CVE-2024-24785 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-GOLANG-2024-24785 changed 2026-01-28 | Apache-2.0 |