Skip to main content

Go html/template EUVDEUVD-2026-28426

| CVE-2026-39826 MEDIUM
Improper Encoding or Escaping of Output (CWE-116)
2026-05-07 Go GHSA-3v2c-x6q9-f697
6.1
CVSS 3.1 · Vendor: Go
View

Attack ChainAIDerived

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

  1. Access
    Craft malicious data string
  2. Exploit
    Inject into template variable
  3. Execution
    Trigger script execution
  4. Impact
    Exfiltrate sensitive data

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding for downstream
Exploitation Conditions

A trusted template author must write a <script> tag with an empty 'type' attribute or a 'type' attribute containing only ASCII whitespace characters (space, tab, newline, carriage return, form feed). Additionally, the application must pass attacker-controllable data into the script block via template variable interpolation (e.g., {{.UserData}}). No default Go configuration enables this; it requires explicit template code written by the developer. Exploitation requires user interaction (UI:R in CVSS vector) to visit a page containing the vulnerable template. Standard Go configurations with properly-formed script tags and correct contextual escaping are not affected.

Impact

This vulnerability presents a nuanced risk profile where CVSS and EPSS signals diverge significantly. The CVSS score of 6.1 (with AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L) is moderated by UI:R (user interaction required) and PR:N (no privileges), but EPSS at 0.01% percentile 2 indicates exceptionally low real-world exploitation probability. The discrepancy reflects SSVC framing: exploitation requires a trusted template author to deliberately or accidentally write a script tag with an empty/whitespace type attribute, then deploy that template in a context where an attacker can influence data passed into that script block. This represents a supply-chain or internal development risk rather than a direct attack surface. The Information Disclosure tag confirms the vulnerability does not enable arbitrary code execution or availability impact, only data leakage. No CISA KEV listing or public exploit code is present, further indicating this is a low-priority remediation despite the moderate CVSS. Real-world risk depends entirely on template authoring practices and input validation discipline within the Go application.

Exploit ScenarioDerived

A Go application uses an html/template with a user-controlled data parameter inserted into a script block: <script type=''>var data = {{.UserData}};</script>. A trusted template developer writes this accidentally or through legacy code. When a user visits a page containing this template with attacker-controlled data, the data is insufficiently escaped, allowing injection of JavaScript code that executes in the user's browser with access to page-local variables and session cookies.

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

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

Alert me

AnalysisAIv1 – May 08, 2026

Go's html/template library incorrectly escapes data passed into <script> tags when the tag contains an empty or whitespace-only 'type' attribute, allowing a trusted template author to inadvertently expose sensitive information to client-side scripts. Affects html/template versions prior to 1.26.3 and 1.25.10. CVSS 6.1 with user interaction required; EPSS 0.01% indicates minimal real-world exploitation likelihood despite moderate base score.

RemediationAI

Vendor-released patch: upgrade to html/template 1.26.3 or later for Go 1.26.x users, or html/template 1.25.10 or later for Go 1.25.x users. These versions correct the type attribute validation logic to properly recognize empty and whitespace-only type attributes as non-script contexts, applying appropriate escaping. Coordinate upgrade timing with Go release channels; patch details and release notes available at https://go.dev/cl/771180 and https://pkg.go.dev/vuln/GO-2026-4980. For applications unable to upgrade immediately, audit existing templates for <script> tags with empty or whitespace-only type attributes and replace them with properly-formed type attributes (e.g., type='text/javascript' or remove the attribute entirely if not required). Implement template code review processes to catch this pattern during development.

Affected VersionsENISA

html/template 1.26.0-0 <1.26.3
html/template 0 <1.25.10

Affected Packages

go stdlib fix: 1.25.10, 1.26.3
euvd html_template fix: 1.25.10, 1.26.3

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

The Go html/template package provides contextual HTML escaping to prevent injection vulnerabilities. The vulnerability resides in the template parser's handling of script tag type attributes: when the 'type' attribute is empty or contains only ASCII whitespace characters (space, tab, newline, carriage return, form feed), the parser fails to recognize this as a script context and applies incorrect escaping rules. This allows data interpolation within the script block to bypass the intended HTML entity encoding that would normally occur. The root cause appears to be improper validation of the 'type' attribute value during template compilation, affecting the context-sensitive escaping logic. CPE cpe:2.3:a:go_standard_library:html/template:*:*:*:*:*:*:*:* identifies the Go standard library's html/template as the affected component.

Know when Html Template 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 (Go) PRIMARY 6.1 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
SUSE MEDIUM
Red Hat 5.4 MEDIUM

Primary rating from Vendor (Go).

CVSS VectorVendor: Go

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

Lifecycle Timeline

4
CVSS changed
May 08, 2026 - 15:22 NVD
6.1 (MEDIUM)
Patch available
May 07, 2026 - 21:02 EUVD
CVE Published
May 07, 2026 - 19:41 nvd
UNKNOWN (no severity yet)
CVE Published
May 07, 2026 - 19:41 nvd
MEDIUM 6.1

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 98% exploitable
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment MSRC Vendor VulDB

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.0%
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
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

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

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
openSUSE Tumbleweed Fixed
SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS Affected
SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS Affected
SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS Affected
SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS Affected

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