Skip to content

html/template: JS template literal context incorrectly tracked #78331

@neild

Description

@neild

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.
 
This only affects templates that use template actions within JS template literals.
 
 
This is CVE-2026-32289 and Go issue https://go.dev/issue/78331.


This is a PRIVATE issue for CVE-2026-32289, tracked in http://b/491530416 and fixed by https://go-internal-review.git.corp.google.com/c/go/+/3882.

/cc @golang/security and @golang/release

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsFixThe path to resolution is known, but the work has not been done.Securityrelease-blocker

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions