Skip to main content

Go html/template EUVDEUVD-2026-95416

| CVE-2026-97030 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
6.1
CVSS 3.1 · Vendor
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify Go app using vulnerable template with yield
  2. Delivery
    Craft input reaching mis-escaped regexp literal
  3. Exploit
    Break JS context via faulty escaping
  4. Execution
    Victim browser loads page and executes injected script
  5. Impact
    Session/credential theft or client-side compromise

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the affected Go application's own trusted html/template source contains the JavaScript yield keyword immediately preceding a regular-expression literal, and that attacker-influenced data is interpolated into that mis-escaped region - this specific template construct is the hard prerequisite and is not present in typical templates. Limiting factors: the template author must have written this pattern (a self-inflicted but non-default condition), the application must server-render HTML via html/template rather than serve JSON APIs, a victim must load the rendered page (user interaction), and only applications upgrading to or already on the unpatched Go toolchain versions are affected. There is no remote unauthenticated path against a default/empty configuration; the vulnerability is latent unless the yield-plus-regexp template construct exists.

Impact

This analysis is scoped to CVE-2026-97030 only (html/template: recognize |yield| as regexp preceder keyword), one of several fixes bundled in the Go 1.27.2 / 1.26.9 release announcement. No CVSS vector, CWE, EPSS score, KEV listing, or POC is provided in the input, so quantitative exploitation signals are entirely absent and cannot be compared. Qualitatively, this is a template auto-escaping context-tracking defect: when a trusted template author uses the JavaScript yield keyword, html/template previously failed to recognize it as a regexp-preceder keyword, causing a following regular-expression literal to be mis-contextualized and improperly escaped. The real-world risk is conditional and modest: exploitation is not a direct remote-code or crash path but a potential cross-site scripting (XSS) exposure that only materializes if (a) an application's own trusted template happens to use the yield keyword in the specific JS context and (b) attacker-influenced data flows into the mis-escaped region. This is therefore a low-to-moderate real-world priority despite being in a widely used standard library - it is not a high-CVSS-but-low-risk issue so much as an unscored, narrow-trigger escaping bug. It stands in sharp contrast to sibling CVEs in the same release (e.g. the HTTP/2 crash CVE-2026-97032, the Trailer memory-exhaustion CVE-2026-78659, or the CONNECT desync CVE-2026-...) which are remotely triggerable by a malicious client against default servers; this particular issue requires a specific template construct to exist in the victim application. No conflicting signals exist because almost no risk metadata was supplied - the primary caveat is simply the near-total absence of scoring data.

Exploit ScenarioDerived

A Go web application renders a server-side html/template that embeds the yield keyword inside a JavaScript context followed by a regular-expression literal that incorporates request-derived data. Because html/template did not recognize yield as a regexp-preceder keyword, the following literal is mis-escaped, allowing an attacker who controls that data to break out of the intended JS context and inject script that executes in a victim's browser. No public exploit identified at time of analysis; exploitation is passive, requiring a victim to load the affected page.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 08, 2026

Improper JavaScript context tracking in Go's html/template package fails to treat the yield keyword as a regular-expression preceder, so a regexp literal that follows yield inside a template-literal expression is mis-escaped instead of being correctly recognized and neutralized. Only applications that server-render HTML with html/template and whose trusted template source actually contains this specific yield-plus-regexp construct are meaningfully exposed, and a victim must load the rendered page (CVSS PR:N - no authentication required, but UI:R - user interaction required). No public exploit code identified at time of analysis; fixes ship in Go 1.27.2 and Go 1.26.9.

RemediationAI

Vendor-released patch: Go 1.27.2 and Go 1.26.9. Upgrade the Go toolchain to one of those releases, then rebuild and redeploy every affected binary, since the vulnerable html/template code is compiled into the artifact rather than resolved at runtime; GOTOOLCHAIN=go1.27.2 can be used to force the corrected toolchain in build pipelines. Where immediate rebuilding is not possible, audit templates for the yield keyword immediately followed by a regexp literal and rewrite that construct - for example by moving the regular expression into a RegExp constructor call or hoisting it outside the template-literal expression - or by removing interpolation of untrusted data from that region; the trade-off is manual template review effort and the risk that a rewritten expression changes intended rendering behavior, and neither workaround removes exposure for templates not covered by the audit. Note that the sibling html/template context-tracking fix (CVE-2026-94448, https://go.dev/issue/81821) and the other issues bundled in the same release announcement (net/http HTTP/2 HPACK and Trailer flaws, crypto/tls ECH, cmd/go checksum bypasses, MIME multipart limit bypass, HTTP/1 CONNECT desynchronization) require the same toolchain upgrade and rebuild.

Affected VersionsENISA

html/template 1.27.0-0 <1.27.2
html/template 0 <1.26.9

Affected Packages

go stdlib fix: 1.26.9, 1.27.2
euvd html_template fix: 1.26.9, 1.27.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Go's html/template performs contextual auto-escaping: it parses template text alongside the surrounding HTML/JavaScript context and tracks state (HTML text, script block, template literal, regexp literal, etc.) so it can apply the correct escaping to each interpolated value. Inside JavaScript template literals, the parser must know which tokens can precede a regular-expression literal; the yield keyword (as used in generator functions) is a valid regexp preceder, but the escaping engine did not recognize it as such. The result is that a regexp literal appearing immediately after yield was not classified as a regexp literal, causing context mis-tracking and incorrect escaping of subsequent interpolated data - a context-dependent output-encoding failure of the same class as script-injection/XSS defects. A closely related fix in the same release, incorrect reset of context variables across consecutive template-literal expressions, is tracked separately as CVE-2026-94448 and should not be conflated with this CVE. No CWE identifier was supplied in the source feed, and no CPE entries were provided.

Know when Golang gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (CNA) PRIMARY 6.1 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
vuln.today AI 4.7 MEDIUM

Web-delivered XSS so AV:N and scope-changing S:C into the victim browser; AC:H because a specific yield+regexp template construct must exist; UI:R as a victim must load the page; no availability impact.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (CNA).

CVSS VectorVendor

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

Lifecycle Timeline

2
CVSS changed
Oct 15, 2026 - 16:22 NVD
6.1 (MEDIUM)
CVE Published
Oct 08, 2026 - 19:26 oss-security
CRITICAL

Description PRE-NVD

Disclosed via oss-security. NVD scoring and full description are pending.

Executive ViewAI

Why It Matters

A critical vulnerability in Go's html/template package could allow attackers to bypass output encoding in server-rendered web applications, potentially leading to cross-site scripting attacks against end users. The flaw is unauthenticated but requires user interaction, and only applications running affected Go versions whose trusted template source contains a specific yield-plus-regexp construct are meaningfully exposed; no public exploit has been identified at time of analysis. Engineering leadership should prioritize identifying and upgrading affected Go deployments to fixed releases to prevent potential session hijacking or data exposure.

Business Impact: Medium
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.2%
Top 93% exploitable
Prevalence
High
Go stdlib html/template, the standard package for server-rendered HTML in Go web apps
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
Medium

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

More in Golang

View all
CVE-2023-44487 HIGH POC
7.5 Oct 10

Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour

CVE-2023-48795 MEDIUM POC
5.9 Dec 18

The SSH transport protocol with certain OpenSSH extensions, found in OpenSSH before 9.6 and other products, allows remot

CVE-2016-5386 HIGH
8.1 Jul 19

The net/http package in Go through 1.6 does not attempt to address RFC 3875 section 4.1.18 namespace conflicts and there

CVE-2026-24897 CRITICAL POC
10.0 Jan 28

Erugo file-sharing platform up to version 0.2.14 has a CVSS 10.0 path traversal allowing authenticated users to read any

CVE-2025-68121 CRITICAL POC
10.0 Feb 05

Critical certificate validation bypass in Go crypto/tls during session resumption. If ClientCAs or RootCAs fields are mu

CVE-2022-50926 CRITICAL POC
9.8 Jan 13

WAGO PFC200 G2 PLC (firmware affected) allows privilege escalation through cookie manipulation. Users can modify cookie

CVE-2026-28408 CRITICAL POC
9.8 Feb 27

Authentication bypass in WeGIA charitable institution management system before 3.6.5. The adicionar_tipo_docs_atendido.p

CVE-2026-24895 CRITICAL POC
9.8 Feb 12

CGI path splitting vulnerability in FrankenPHP before 1.11.2 — Unicode characters bypass path validation during CGI proc

CVE-2019-14809 CRITICAL POC
9.8 Aug 13

net/url in Go before 1.11.13 and 1.12.x before 1.12.8 mishandles malformed hosts in URLs, leading to an authorization by

CVE-2025-66719 CRITICAL POC
9.1 Jan 23

Free5gc NRF 1.4.0 has an authorization bypass in access token generation that allows authenticated users to request toke

CVE-2022-50909 HIGH POC
8.8 Jan 13

Algo 8028 Control Panel version 3.3.3 contains a command injection vulnerability in the fm-data.lua endpoint that allows

CVE-2026-82410 HIGH POC
8.7 Sep 16

Denial of service in PocketBase versions prior to 0.22.48 (0.22.x branch) and 0.23.0 through 0.39.6 (0.23.0+ branch) all

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy