Skip to content
Heist/ feed
Back to feed
UnratedFix available

JsBraceDepth Context Tracking Bugs (XSS) in html/template

Type: advisorySources: OSV

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.

Products
stdlib
Affected versions
Not specified
Fixed versions
1.25.9, 1.26.2
CVEs
CVE-2026-32289
Confirmed fixed CVEs
Not specified
Updated in this feed
28 Oct 2026, 03:50 UTC · Revision 1

Source evidence

JsBraceDepth Context Tracking Bugs (XSS) in html/template

core-osv · Original source

Published 7 Apr 2026, 22:53 UTC

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.

osv:GO-2026-4865

stdlib

Fixed versions: 1.25.9, 1.26.2

Complete source record
{
  "id": "21961b6c38f7907e156a9fb4c2306351fdd2f1c3f778e758a1f2e15c1eebc782",
  "url": "https://osv.dev/vulnerability/GO-2026-4865",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "JsBraceDepth Context Tracking Bugs (XSS) in html/template",
    "summary": "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.",
    "evidence": "osv:GO-2026-4865",
    "products": [
      {
        "name": {
          "value": "stdlib",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "1.25.9",
            "evidence": "/affected/0/ranges"
          },
          {
            "value": "1.26.2",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "GO-2026-4865",
      "aliases": [
        "BIT-golang-2026-32289",
        "CVE-2026-32289",
        "GO-2026-4865"
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "1.25.9"
                },
                {
                  "introduced": "1.26.0-0"
                },
                {
                  "fixed": "1.26.2"
                }
              ]
            }
          ],
          "package": {
            "name": "stdlib",
            "purl": "pkg:golang/stdlib",
            "ecosystem": "Go"
          },
          "database_specific": {
            "source": "https://vuln.go.dev/ID/GO-2026-4865.json"
          },
          "ecosystem_specific": {
            "imports": [
              {
                "path": "html/template",
                "symbols": [
                  "Error.Error",
                  "HTMLEscaper",
                  "JSEscape",
                  "JSEscapeString",
                  "JSEscaper",
                  "ParseFS",
                  "ParseFiles",
                  "ParseGlob",
                  "Template.AddParseTree",
                  "Template.Clone",
                  "Template.DefinedTemplates",
                  "Template.Execute",
                  "Template.ExecuteTemplate",
                  "Template.Funcs",
                  "Template.Parse",
                  "Template.ParseFS",
                  "Template.ParseFiles",
                  "Template.ParseGlob",
                  "URLQueryEscaper",
                  "context.String",
                  "context.mangle",
                  "escaper.escapeBranch"
                ]
              }
            ]
          }
        }
      ],
      "modified": "2026-10-07T10:41:46.025548889Z",
      "provider": "osv",
      "references": [
        "https://go.dev/cl/763762",
        "https://go.dev/issue/78331",
        "https://groups.google.com/g/golang-announce/c/0uYbvbPZRWU"
      ],
      "provider_metadata": {
        "url": "https://pkg.go.dev/vuln/GO-2026-4865",
        "review_status": "REVIEWED"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-32289",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 94941,
  "published_at": "2026-04-07T22:53:49+00:00"
}