Skip to main content

golang.org/x/net/html CVE-2026-42506

| EUVDEUVD-2026-31446 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-05-22 Go GHSA-cg87-vwwh-xvgj
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 crafts mutation XSS HTML payload
  2. Delivery
    Submits payload to Go application accepting user HTML input
  3. Exploit
    Application parses HTML with golang.org/x/net/html
  4. Execution
    Sanitization traversal removes apparent threats from node tree
  5. Persist
    html.Render() serializes tree with structural divergence from sanitized state
  6. Impact
    Victim loads page, browser reconstructs and executes XSS payload

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 target application implements a specific pipeline: (1) user-supplied HTML is parsed with golang.org/x/net/html, (2) a sanitization step is applied to the parsed node tree in memory, and (3) the sanitized tree is re-serialized using html.Render() as the output path. Applications that do not call html.Render() for output, that apply output-based sanitization instead of parse-tree-based sanitization, or that do not re-render user-supplied HTML at all are not exposed to XSS risk from this issue. User interaction is required (UI:R per CVSS) - a victim must load the page containing the rendered attacker-supplied content. No authentication is required from the attacker's perspective (PR:N per CVSS). Non-default configuration is implicitly required in that the vulnerable pattern is only relevant to applications that use this library specifically as a security sanitization layer rather than for general-purpose HTML processing.

Impact

The CVSS base score of 6.1 (Medium) reflects Changed scope (S:C), indicating that XSS impact crosses security boundaries from the server component into the victim's browser session - consistent with client-side script execution. The attack vector is Network (AV:N) with Low complexity (AC:L) and no privileges required (PR:N), but user interaction is mandatory (UI:R), meaning a victim must load a page rendering attacker-supplied content. EPSS at 0.03% (9th percentile) and SSVC exploitation status of 'none' together confirm no observed in-the-wild activity at time of analysis. The SSVC automatable flag of 'no' is consistent with the UI:R requirement, indicating mass automated exploitation is not trivially feasible. SSVC technical impact of 'partial' aligns with the Low confidentiality and Low integrity CVSS impact ratings. The primary risk is concentrated in Go applications that explicitly use this library as a security-relevant sanitization component - a subset of users who are disproportionately exposed precisely because they are relying on the library for a guarantee it does not provide. Applications using the parser purely for data extraction without re-rendering have no XSS exposure from this issue.

Exploit ScenarioDerived

An attacker submits crafted HTML - such as a forum post, comment, or profile field - to a Go web application that uses golang.org/x/net/html to parse, sanitize, and re-render user content. The sanitization step removes apparent script tags from the parsed node tree, but html.Render() serializes the tree using HTML5 normalization rules that reconstruct an executable XSS payload in the final output. When an authenticated victim's browser loads the rendered page, the payload executes in their session context and can steal cookies, perform authenticated actions, or exfiltrate data. No public exploit 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

XSS sanitization bypass in Go's extended networking HTML parser (golang.org/x/net/html) allows remote unauthenticated attackers to execute cross-site scripting payloads against victims of Go web applications that rely on the library's parse-sanitize-render pipeline. The vulnerability arises because html.Render() can serialize a parsed and sanitized node tree into HTML output that structurally diverges from the sanitized intermediate representation, causing attacker-controlled content to re-materialize in rendered output. No active exploitation is confirmed (CISA KEV absent, EPSS 0.03%), but any Go application using this library as a sanitization layer is structurally exposed until upgraded to version 0.55.0.

RemediationAI

Upgrade golang.org/x/net to version 0.55.0 or later by running go get golang.org/x/net@v0.55.0 and rebuilding all affected services. The fix is documented at pkg.go.dev/vuln/GO-2026-5025 and implemented in code change https://go.dev/cl/781700. For teams unable to patch immediately, the most effective compensating control is replacing the parse-sanitize-render pipeline with a dedicated HTML sanitization library such as bluemonday, which serializes output independently of golang.org/x/net/html's Render() function, eliminating the parser-differential attack surface entirely. Alternatively, applying a strict allow-list output encoding pass after Render() can reduce exposure, but adds complexity and is not a substitute for patching. Deploying strict Content Security Policy headers (script-src 'self' or nonce-based) limits the impact of any XSS that does execute, though CSP is a defense-in-depth layer and should not be treated as primary mitigation. The golang-announce mailing list entry at https://groups.google.com/g/golang-announce/c/iI-mYSI0lu8 contains additional advisory context.

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 golang.org/x/net/html, Go's extended HTML parsing library implementing an HTML5-compliant tokenizer and tree builder (CPE: cpe:2.3:a:golang.org/x/net:golang.org/x/net/html:*:*:*:*:*:*:*:*). The vulnerability is rooted in CWE-79 (Improper Neutralization of Input During Web Page Generation). Applications commonly adopt a parse-sanitize-render pipeline: raw HTML is parsed into a node tree, unwanted nodes or attributes are removed via tree traversal, and the cleaned tree is serialized back to HTML via Render(). The flaw is that Render() can produce output that does not faithfully represent the sanitized tree - likely due to normalization differences, implicit HTML5 tree corrections, or serialization edge cases - allowing attacker-controlled markup to survive into final output. This is consistent with the class of vulnerability known as mutation XSS (mXSS), where parser differentials between sanitization and rendering stages invalidate sanitization guarantees. The issue is tracked upstream at go.dev/issue/79571 and addressed by code change go.dev/cl/781700.

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 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

2
CVSS changed
May 29, 2026 - 19:07 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
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment MSRC Vendor CIRCL GitHub 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 Yes
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

50
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: +20
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