Skip to content

html/template: XSS via stale jsCtx at template-literal expression entry, tJSTmpl ${ #81821

Closed

Description

@thatnealpatel

html/template: reset context tracking on consecutive template expressions

When a JavaScript template literal contains
consecutive expressions, the context tracking
state was not properly reset upon entering a
new expression.

We now ensure that template-literal expression
entries correctly reset context variables so all
subsequent regular expression literals are
accurately recognized and escaped.

This is CVE-2026-94448 and Go issue https://go.dev/issue/81821.


This was a PUBLIC track issue originally tracked in http://b/545173298.

Activity

  1. gopherbot commented on Sep 28, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/839866 mentions this issue: html/template: reset JS context for template expressions

  2. added this to the Go1.28 milestone on Sep 29, 2026
  3. thatnealpatel commented on Sep 30, 2026

    @thatnealpatel
    MemberAuthor

    @gopherbot Please open backports for this security issue.

  4. gopherbot commented on Sep 30, 2026

    @gopherbot
    Contributor

    Backport issue(s) opened: #81923 (for 1.26), #81924 (for 1.27).

    Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

  5. gopherbot commented on Oct 1, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/843225 mentions this issue: html/template: reset JS context for template expressions

  6. gopherbot commented on Oct 1, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/843187 mentions this issue: html/template: reset JS context for template expressions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions