CVE-2026-25681 Invoking incorrect handling of character references in DOCTYPE nodes in golang.org/x/net/html

Medium 6.1 Published Updated

Attackers can execute XSS in applications sanitizing HTML via the Go net/html library due to incorrect DOCTYPE character reference handling.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-25681?

CVE-2026-25681 is a medium-severity cross-site scripting vulnerability in golang.org/x/net/html, published on 22 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

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

Weakness: CWE-1021

Which versions are affected by CVE-2026-25681?

1 open source package ship an affected version, including golang.org/x/net. It affects 1 product.

PackageAffectedFixed in
golang.org/x/net GoAll versions0.55.0

Products include Golang Net.

How do I fix CVE-2026-25681?

Upgrade golang.org/x/net to 0.55.0 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-25681 being exploited?

There is no known exploitation of CVE-2026-25681 in the wild and no public exploit code.

Sources

Also known as AZL-87158, AZL-87221, AZL-87314, AZL-87344, AZL-87378, AZL-87435 and 1371 more.

Is CVE-2026-25681 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free