Description
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.
Published: 2026-05-22
Score: 6.1 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The golang.org/x/net/html package parses arbitrary HTML that is later rendered with Render. When namespaced elements in foreign content are handled incorrectly, the resulting HTML tree can be altered in an unexpected way, allowing an attacker to insert malicious payloads that execute in a victim's browser. This leads to an XSS vulnerability that can affect client‑side confidentiality, integrity, and availability by executing arbitrary JavaScript in the context of the user’s session.

Affected Systems

Applications using the golang.org/x/net HTML parsing library, specifically golang.org/x/net/html, are vulnerable if they accept and render untrusted HTML input. The issue applies to all versions of the library that have not been updated to address this parsing flaw.

Risk and Exploitability

The EPSS score for this CVE is not available and it is not listed in the CISA KEV catalog, so no current exploitation data is provided. Because the vulnerability requires an application to parse and render arbitrary HTML, it is inferred that the attack vector is a user‑supplied HTML payload that reaches the Render call. In environments where this library is used to sanitize or display user content, the risk of exploitation is moderate to high pending a patch, but lack of publicly known exploits means the immediate threat level may be lower than typical XSS scenarios. The CVSS score of 6.1 indicates a moderately high impact, quantifying the potential severity of the XSS vulnerability.

Generated by OpenCVE AI on May 22, 2026 at 19:53 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade golang.org/x/net/html to the most recent release that contains the XSS fix
  • Add an additional sanitization layer that removes or rejects unsupported namespaced elements before passing content to Render
  • Deploy a Content Security Policy header in the web application to reduce the impact of any remaining script injection

Generated by OpenCVE AI on May 22, 2026 at 19:53 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 22 May 2026 18:15:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 22 May 2026 15:45:00 +0000

Type Values Removed Values Added
Description 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.
Title Invoking incorrect handling of namespaced elements in foreign content in golang.org/x/net/html
References

Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: Go

Published:

Updated: 2026-05-22T17:45:49.989Z

Reserved: 2026-04-28T00:21:12.792Z

Link: CVE-2026-42506

cve-icon Vulnrichment

Updated: 2026-05-22T17:45:46.046Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-22T20:00:13Z

Weaknesses

No weakness.