CVE-2026-42502: Invoking incorrect handling of HTML elements in foreign content in golang.org/x/net/html
Invoking incorrect handling of HTML elements in foreign content in golang.org/x/net/html
Other sources
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.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 4.0.2-9 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.14.0-15 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.8.1-4 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.14.1-14 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.31.0-23 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.2.4-3 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.62.0-17 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.5.1-5 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.27.0-13 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.4.0-6 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.7.0-6 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 8.7.11-7 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.30.10-25 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.9.5-14 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.12.0-6 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.7.1-5 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.32.0-6 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.7.5-17 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.12.15-8 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.62.0-5 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.7.7-4 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.0.10-6 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.2.4-4
Event History
Frequently Asked Questions
What is the severity of CVE-2026-42502?
CVE-2026-42502 has a risk rating of 53, indicating a moderate level of severity.
How do I fix CVE-2026-42502?
To mitigate CVE-2026-42502, ensure proper validation and sanitization of HTML content before rendering.
What impact does CVE-2026-42502 have on my application?
CVE-2026-42502 can lead to unexpected HTML structures, potentially enabling XSS attacks if the application renders untrusted HTML.
Which software is affected by CVE-2026-42502?
CVE-2026-42502 affects the golang/golang.org/x/net/html package.
When was CVE-2026-42502 published?
CVE-2026-42502 was published on May 22, 2026.