Skip to main content

Go x/net/html CVE-2026-42502

| EUVDEUVD-2026-31448 MEDIUM
Improper Restriction of Rendered UI Layers or Frames (CWE-1021)
2026-05-22 Go GHSA-wrh2-89vg-4j9g
6.1
CVSS 3.1 · Vendor: Go
View

Attack ChainAIDerived

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

  1. Access
    Attacker submits crafted HTML payload
  2. Delivery
    Application sanitizes using golang.org/x/net/html parse-render roundtrip
  3. Exploit
    Parser-render mismatch preserves malicious structure
  4. Execution
    Sanitized string stored or reflected
  5. Persist
    Victim loads page with rendered output
  6. Impact
    Browser executes injected JavaScript

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V3 - Web Frontend Security Clickjacking prevention, X-Frame-Options
Exploitation Conditions

Exploitation requires that the vulnerable application use golang.org/x/net/html versions before 0.55.0 specifically in a sanitize-then-render pipeline: the application must call html.Parse on untrusted input, walk or filter the resulting tree for dangerous content, and then call html.Render to produce output that is subsequently displayed to other users. Applications that do not use golang.org/x/net/html for HTML sanitization, or that do not render the output back to users, are not affected. Exploitation additionally requires a victim user to view the rendered content (UI:R), limiting automatable mass exploitation. The CVSS PR:N vector confirms no authentication is required on the attacker's side to submit the malicious payload, though the target application's own access controls may impose additional barriers.

Impact

The CVSS 6.1 score is driven by network reachability (AV:N), low complexity (AC:L), no authentication (PR:N), changed scope (S:C), and low confidentiality/integrity impact - a profile consistent with reflected or stored XSS. However, user interaction is required (UI:R), meaning a victim must load or view the attacker-controlled content. Real-world risk is tempered by several factors: EPSS is 0.03% (9th percentile), indicating very low observed exploitation probability; SSVC rates exploitation as none, automatable as no, and technical impact as partial, collectively suggesting limited active threat at present. Critically, only applications that use golang.org/x/net/html as part of a sanitization pipeline are exposed - libraries or applications that do not attempt HTML sanitization with this package and then render it are unaffected. Despite the low current exploitation signals, the attack class (mXSS sanitizer bypass) is well-understood and the fix is available, making patching straightforward and recommended. No data conflict between CVSS and description is apparent.

Exploit ScenarioDerived

An attacker submits a specially crafted HTML payload to a web application - for example, a comment or profile bio field - that uses golang.org/x/net/html to sanitize input before storing and displaying it. The application's sanitizer walks the parsed tree, removes script tags and event handlers, and calls html.Render to produce the stored string. Due to the parse-render discrepancy, the rendered output contains executable JavaScript that was absent from the sanitized tree. When another user views the page, the injected script executes in their browser, stealing session tokens or performing actions on their behalf. No public proof-of-concept code has been identified at time of analysis.

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 29, 2026

Mutation XSS in Go's golang.org/x/net/html package allows attackers to bypass HTML sanitization by exploiting a discrepancy between how the html.Parse() function constructs an internal tree and how html.Render() serializes it back. Applications that rely on this package to sanitize untrusted HTML before display are vulnerable: maliciously crafted input can survive sanitization and execute JavaScript in victims' browsers when the rendered output is viewed. No public exploit exists at time of analysis, though the Go security team has issued a fix in version 0.55.0.

RemediationAI

Upgrade golang.org/x/net to version 0.55.0 or later, which contains the code change at https://go.dev/cl/781701 that corrects the parse-render mismatch. The Go announce list post at https://groups.google.com/g/golang-announce/c/iI-mYSI0lu8 and the vulnerability database entry at https://pkg.go.dev/vuln/GO-2026-5027 provide full upgrade guidance. Run 'go get golang.org/x/net@v0.55.0' and update your go.sum accordingly. If an immediate upgrade is not feasible, applications should avoid using html.Render to produce output after sanitizing with html.Parse, and instead use a dedicated, well-maintained HTML sanitizer library that does not depend on this round-trip pattern. Disabling the affected sanitization flow and rejecting all untrusted HTML input is the most conservative compensating control, though it may break legitimate rich-text features.

Affected VersionsENISA

golang.org/x/net/html 0 <0.55.0

Affected Packages

go golang.org/x/net fix: 0.55.0
euvd golang_org_x_net_html fix: 0.55.0

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 affected component is the golang.org/x/net/html package (CPE: cpe:2.3:a:golang.org/x/net:golang.org/x/net/html:*:*:*:*:*:*:*:*), Go's extended HTML parsing and rendering library. The root cause is classified as CWE-1021 (Improper Restriction of Rendered UI Layers or Frames), reflecting a parse-render mismatch: the parser constructs an HTML tree that, when serialized back via Render, produces structurally different HTML than what was originally parsed. This is the classic mutation XSS (mXSS) class of vulnerability. Applications commonly use this package in a sanitize-then-render pipeline: parse untrusted HTML, walk the tree to remove dangerous nodes, then render back to a string for display. Because the Render output can differ structurally from the parsed input, a sanitizer may inspect a safe tree while the rendered output re-introduces executable content the sanitizer never saw.

Know when Golang Org X Net Html 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 6.1 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

2
CVSS changed
May 29, 2026 - 19:22 NVD
6.1 (None) 6.1 (MEDIUM)
CVE Published
May 22, 2026 - 15:01 nvd
UNKNOWN (no severity yet)

DescriptionCVE.org

Parsing arbitrary HTML which is then rendered using Render can result in an unexpected HTML tree. This can be leveraged to execute XSS attacks in applications that attempt to sanitize input HTML before rendering.

Threat Intelligence Overview

EPSS Score
0.0%
Top 91% exploitable
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High

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

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

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
openSUSE Leap 16.0 Fixed
openSUSE Tumbleweed Fixed
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 12 Fixed

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