GO-2026-4865

Source
https://pkg.go.dev/vuln/GO-2026-4865
Import Source
https://vuln.go.dev/ID/GO-2026-4865.json
JSON Data
https://api.osv.dev/v1/vulns/GO-2026-4865
Aliases
Downstream
Related
Published
2026-04-07T22:53:49Z
Modified
2026-07-10T10:44:23Z
Summary
JsBraceDepth Context Tracking Bugs (XSS) in html/template
Details

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.

Database specific
{
    "review_status": "REVIEWED",
    "url": "https://pkg.go.dev/vuln/GO-2026-4865"
}
References

Affected packages

Go / stdlib

Package

Name
stdlib
View open source insights on deps.dev
Purl
pkg:golang/stdlib

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.25.9
Introduced
1.26.0-0
Fixed
1.26.2

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"
            ]
        }
    ]
}

Database specific

source
"https://vuln.go.dev/ID/GO-2026-4865.json"