Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-97030 Overview
CVE-2026-97030 affects the Go html/template package. The vulnerability stems from improper escaping of the yield keyword in previously valid templates authored by trusted developers. When yield appeared in a template context, the escaper did not consistently differentiate between valid keyword uses and non-keyword uses, leading to inconsistent output encoding. The fix ensures valid keyword uses are escaped while non-keyword uses are not escaped. The flaw is tracked by the Go security team as GO-2026-6600 and is classified as [CWE-79] Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).
Critical Impact
Rendered HTML templates may deliver content that is not escaped as the author expected, creating conditions that can enable reflected cross-site scripting (XSS) against users who interact with crafted template output.
Affected Products
- Go standard library html/template package
- Applications and web services built on affected Go versions
- Downstream frameworks that rely on html/template for output encoding
Discovery Timeline
- 2026-10-08 - CVE-2026-97030 published to NVD
- 2026-10-15 - Last updated in NVD database
Technical Details for CVE-2026-97030
Vulnerability Analysis
The Go html/template package applies context-aware escaping to template output. The escaper inspects tokens produced by the template parser and selects an escaping strategy based on the surrounding HTML, attribute, JavaScript, URL, or CSS context. The yield identifier interacts with this logic in a way that caused valid templates to receive incorrect escaping treatment.
The advisory notes that a trusted template author may have written a valid template in which the yield keyword was not correctly escaped. The patched behavior enforces that valid keyword uses are escaped and non-keyword uses are not escaped. This asymmetry is the root of the issue: output that developers assumed was safe could reach the browser without the expected neutralization applied.
The weakness maps to [CWE-79]. Exploitation requires user interaction, as reflected in the attack vector, and can impact both confidentiality and integrity at a limited scope while changing security scope to a downstream component (the user's browser).
Root Cause
The escaper's handling of the yield identifier failed to apply consistent output encoding rules. Context analysis within html/template did not reliably distinguish between keyword and non-keyword occurrences, allowing content paths through the renderer without the escaping a template author would expect.
Attack Vector
An attacker submits input that is reflected into a Go-rendered HTML template that uses the yield keyword in a susceptible pattern. When a victim loads the rendered page, unescaped markup or script content executes in the victim's browser session. The attack is remote, requires low complexity, and depends on user interaction such as clicking a crafted link. Technical details are documented in the Go issue tracker entry and the Go.dev code change note.
No verified public proof-of-concept code is available. The vulnerability is described in prose in the upstream references rather than through released exploit code.
Detection Methods for CVE-2026-97030
Indicators of Compromise
- Unexpected <script> tags, event handler attributes, or HTML entities appearing in rendered pages generated by Go html/template
- Web server access logs showing requests with HTML or JavaScript payloads reflected into template-rendered responses
- Content Security Policy (CSP) violation reports originating from pages produced by affected Go services
Detection Strategies
- Audit template source files for use of the yield keyword and review the surrounding context for user-controlled data
- Run dependency scanners against Go module manifests to identify builds using vulnerable html/template versions referenced by GO-2026-6600
- Use govulncheck to flag binaries and modules that import vulnerable standard library versions
Monitoring Recommendations
- Alert on CSP report-uri endpoints receiving violations from first-party domains hosting Go web applications
- Monitor web application firewall (WAF) telemetry for reflected XSS patterns targeting template-rendered endpoints
- Track outbound requests from end-user browsers to attacker-controlled hosts that may indicate successful script execution
How to Mitigate CVE-2026-97030
Immediate Actions Required
- Upgrade Go toolchains and rebuild applications against the fixed html/template version referenced in the Golang announce group update
- Inventory internal and third-party Go binaries and prioritize services that render user-controlled content
- Review templates that contain the yield keyword and validate the resulting output for proper escaping after patching
Patch Information
The fix is tracked in the Go project under CL 840925 and issue #81823. The patched escaper ensures valid keyword uses of yield are escaped while non-keyword uses are not escaped. Rebuild all Go applications with a toolchain that includes the fix and redeploy affected services. Consult the Go.dev vulnerability report for the exact affected and fixed versions.
Workarounds
- Refactor templates to avoid using the yield keyword in positions that render untrusted input until patched toolchains are deployed
- Deploy a strict Content Security Policy (CSP) with script-src restricted to trusted sources and nonces to limit XSS impact
- Apply server-side input validation and output allowlisting on fields that are rendered by affected templates
# Configuration example: verify Go version and scan modules for CVE-2026-97030
go version
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

