CVE Database›Document archive›CVE-2026-42506

CVE-2026-42506

golang.org/x/net/html: golang.org/x/net/html: Cross-Site Scripting (XSS) via arbitrary HTML parsing

Loading…

Severity

Moderate

Red Hat Product Security

5.4

CVSS 3.1

Review impact separately from score.

Published · May 23, 2026

Updated · November 1, 2026

Description

A flaw was found in golang.org/x/net/html. When parsing arbitrary HTML that is subsequently rendered, an unexpected HTML tree can be generated. A remote attacker could leverage this vulnerability to execute Cross-Site Scripting (XSS) attacks in applications that attempt to sanitize input HTML before rendering, potentially leading to unauthorized actions or information disclosure.

Statement

This Moderate flaw in golang.org/x/net/html can lead to Cross-Site Scripting (XSS) in applications that process and render untrusted HTML, even when input sanitization is implemented. The vulnerability arises from an unexpected HTML tree structure generated during parsing, potentially allowing a remote attacker to execute arbitrary script code in the user's browser, leading to information disclosure or unauthorized actions.

CVSS score applicability

The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.

Mitigation

Update affected Go applications to use golang.org/x/net version 0.55.0 or later. As a workaround, do not use golang.org/x/net/html to parse and re-render untrusted HTML content. Applications that do not parse arbitrary HTML are not affected.

CVSS / CWE

CVSS 3.1 · 5.4
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

CWE-79 · Improper Neutralization of Input During Web Page Generation