CVE-2024-24785: Go Standard Library Html/template

Medium severity, CVSS 5.4. EPSS: 0.9% probability of exploitation activity in the next 30 days.

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.

What to do

The record states a fixed version for each range of affected versions. Update to the one for the range your version is in: a later release on another branch may not have the fix.

  • Go Standard Library Html/template, before 1.21.8: fixed in 1.21.8
  • Go Standard Library Html/template, from 1.22.0-0, before 1.22.1: fixed in 1.22.1

Affected products

Affected packages

Published 2024-03-05. Last modified 2026-06-17.