# CVE-2024-24785: Errors returned from JSON marshaling may break template escaping in html/template

- Severity: Medium 5.4 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.79%, higher than 57% of CVEs (2026-12-01)
- Published: 2024-03-05T22:15:40.000Z
- Modified: 2026-06-17T07:14:51.357Z
- Also known as: GO-2024-2610, BIT-GOLANG-2024-24785
- Related: CGA-gx7j-g27r-6grj
- Weaknesses: CWE-150
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Go

## 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.

(As written by CVE List.)

## Affected

- html/template: before 1.21.8; from 1.22.0-0 before 1.22.1
- stdlib (Go): before 1.21.8; from 1.22.0-0 before 1.22.1
- golang (Bitnami): before 1.21.8; from 1.22.0-0 before 1.22.1

## Every score

- CISA-ADP: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://go.dev/issue/65697> (report, web)
- <https://go.dev/cl/564196> (fix, web)
- <https://groups.google.com/g/golang-announce/c/5pwGVUPoMbg> (web)
- <https://pkg.go.dev/vuln/GO-2024-2610> (web)
- <https://security.netapp.com/advisory/ntap-20240329-0008/> (web)
- <http://www.openwall.com/lists/oss-security/2024/03/08/4> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-24785> (web)

## Sources

- CVE List: [CVE-2024-24785](https://www.cve.org/CVERecord?id=CVE-2024-24785), CVE Terms of Use, modified 2025-03-14
- Go Vulnerability Database: [GO-2024-2610](https://pkg.go.dev/vuln/GO-2024-2610), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2024-24785](https://nvd.nist.gov/vuln/detail/CVE-2024-24785), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-GOLANG-2024-24785](https://osv.dev/vulnerability/BIT-GOLANG-2024-24785), Apache-2.0, modified 2026-01-28

---

Page: https://cve.day/CVE-2024-24785 · Whole record: https://cve.day/CVE-2024-24785.json · Rebuilt by cve.day 2026-11-25T22:58:37.286Z
