{"id":"CVE-2024-24785","state":"PUBLISHED","title":"Errors returned from JSON marshaling may break template escaping in html/template","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.","publishedAt":"2024-03-05T22:22:33.640Z","updatedAt":"2025-03-14T00:55:26.398Z","severity":{"score":5.4,"label":"Medium","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N","source":"CISA-ADP"},"assigner":"Go","products":["Go standard library html/template"],"affected":[{"vendor":"Go standard library","product":"html/template","packageName":"html/template","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"1.21.8","versionType":"semver"},{"version":"1.22.0-0","status":"affected","lessThan":"1.22.1","versionType":"semver"}],"collectionURL":"https://pkg.go.dev","programRoutines":[{"name":"jsValEscaper"},{"name":"escaper.commit"},{"name":"Template.Execute"},{"name":"Template.ExecuteTemplate"}]}],"references":["https://go.dev/issue/65697","https://go.dev/cl/564196","https://groups.google.com/g/golang-announce/c/5pwGVUPoMbg","https://pkg.go.dev/vuln/GO-2024-2610","https://security.netapp.com/advisory/ntap-20240329-0008/","http://www.openwall.com/lists/oss-security/2024/03/08/4"],"weaknesses":[],"ingestedAt":"2026-10-29T20:07:10.607Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/24xxx/CVE-2024-24785.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2024-24785","state":"PUBLISHED","datePublished":"2024-03-05T22:22:33.640Z","dateUpdated":"2025-03-14T00:55:26.398Z","assignerShortName":"Go","assignerOrgId":"1bb62c36-49e3-4200-9d77-64a1400537cc","dateReserved":"2024-01-30T16:05:14.757Z"},"containers":{"cna":{"title":"Errors returned from JSON marshaling may break template escaping in html/template","descriptions":[{"lang":"en","value":"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":[{"vendor":"Go standard library","product":"html/template","packageName":"html/template","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"1.21.8","versionType":"semver"},{"version":"1.22.0-0","status":"affected","lessThan":"1.22.1","versionType":"semver"}],"collectionURL":"https://pkg.go.dev","programRoutines":[{"name":"jsValEscaper"},{"name":"escaper.commit"},{"name":"Template.Execute"},{"name":"Template.ExecuteTemplate"}]}],"references":[{"url":"https://go.dev/issue/65697"},{"url":"https://go.dev/cl/564196"},{"url":"https://groups.google.com/g/golang-announce/c/5pwGVUPoMbg"},{"url":"https://pkg.go.dev/vuln/GO-2024-2610"},{"url":"https://security.netapp.com/advisory/ntap-20240329-0008/"},{"url":"http://www.openwall.com/lists/oss-security/2024/03/08/4"}],"problemTypes":[{"descriptions":[{"lang":"en","description":"CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences"}]}],"providerMetadata":{"shortName":"Go","orgId":"1bb62c36-49e3-4200-9d77-64a1400537cc","dateUpdated":"2024-05-01T17:09:37.492Z"},"credits":[{"lang":"en","value":"RyotaK (https://ryotak.net)"}]},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":5.4,"attackVector":"NETWORK","baseSeverity":"MEDIUM","vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N","integrityImpact":"LOW","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"NONE","privilegesRequired":"LOW","confidentialityImpact":"LOW"}},{"other":{"type":"ssvc","content":{"timestamp":"2024-03-06T18:49:44.784868Z","id":"CVE-2024-24785","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-03-14T00:55:26.398Z"}},{"title":"CVE Program Container","references":[{"url":"https://go.dev/issue/65697","tags":["x_transferred"]},{"url":"https://go.dev/cl/564196","tags":["x_transferred"]},{"url":"https://groups.google.com/g/golang-announce/c/5pwGVUPoMbg","tags":["x_transferred"]},{"url":"https://pkg.go.dev/vuln/GO-2024-2610","tags":["x_transferred"]},{"url":"https://security.netapp.com/advisory/ntap-20240329-0008/","tags":["x_transferred"]},{"url":"http://www.openwall.com/lists/oss-security/2024/03/08/4","tags":["x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-01T23:28:12.537Z"}}]}}}