What’s Vulnerable › Vulnerabilities

CVE-2024-24785: 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.

Affected products

How to fix

Upgrade to a fixed version: Go standard library html/template 1.21.8, 1.22.1. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2024-24785 or the next vulnerability affects your stack