Live threats

All CVEs / Go standard library

CVE-2024-24785Go standard library html/template

Medium 5.4

Priority
32
CVSS 3.1
5.4
EPSS
0.9%
probability of exploitation in 30 days · percentile 58
Auth required
Yes
Published
Mar 5, 2024
Updated
Jun 17, 2026
Category
Application · Cross-platform
SSVC (CISA)
Exploitation: none · Automatable: no · Technical impact: partial
Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N

What happens

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.

Original NVD text.

What to do

  1. Apply the vendor's security update for html/template.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
Go stdlib < 1.21.8 1.21.8 go get stdlib@v1.21.8
Go stdlib ≥ 1.22.0-0 < 1.22.1 1.22.1 go get stdlib@v1.22.1

Per OSV / GitHub Advisories (GO-2024-2610). Check the version in your lockfile before upgrading.

Affected products

As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.

Official advisories

Vendor, CERT and distribution advisories that name this CVE. Original titles.

Official sources

References

Links published by the sources. Open them with care.