GO-2026-4865

JsBraceDepth Context Tracking Bugs (XSS) in html/template

At a glance

Published
Updated
CVE
CVE-2026-32289
Aliases
BIT-golang-2026-32289

Description

Context was not properly tracked across template branches for JS template literals, leading to possibly incorrect escaping of content when branches were used. Additionally template actions within JS template literals did not properly track the brace depth, leading to incorrect escaping being applied. These issues could cause actions within JS template literals to be incorrectly or improperly escaped, leading to XSS vulnerabilities.

Affected packages

PackageVersions
Go · stdlibintroduced 0, fixed 1.25.9, introduced 1.26.0-0, fixed 1.26.2

References

Sources

SourceLicence
OSV.devCC-BY 4.0 — Go Vulnerability Database