CVE-2025-22872 Incorrect Neutralization of Input During Web Page Generation in x/net in golang.org/x/net

Medium 6.5 Published Updated

The Go HTML tokenizer mishandles self-closing tags in foreign content, potentially allowing XSS via DOM scope errors.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-22872?

CVE-2025-22872 is a medium-severity cross-site scripting vulnerability in golang.org/x/net/html, published on 16 Apr 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

The tokenizer incorrectly interprets tags with unquoted attribute values that end with a solidus character (/) as self-closing. When directly using Tokenizer, this can result in such tags incorrectly being marked as self-closing, and when using the Parse functions, this can result in content following such tags as being placed in the wrong scope during DOM construction, but only when tags are in foreign content (e.g. <math>, <svg>, etc contexts).

Which versions are affected by CVE-2025-22872?

3 open source packages ship an affected version, including golang.org/x/net.

PackageAffectedFixed in
golang.org/x/net GoAll versions0.38.0
golang.org/x/net GoAll versions0.38.0
golang.org/x/net GoAll versions0.38.0
Linux distribution packages (37)
kubernetes1.26 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions1.26.15-150400.9.22.1
kubernetes1.28 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions1.28.13-150400.9.14.1
kubernetes1.26 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions1.26.15-150400.9.22.1
kubernetes1.28 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions1.28.13-150400.9.14.1
kubernetes1.23 SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOSAll versions1.23.17-150500.3.21.1
kubernetes1.26 SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOSAll versions1.26.15-150400.9.22.1
kubernetes1.28 SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOSAll versions1.28.13-150400.9.14.1
kubernetes1.23 SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSSAll versions1.23.17-150500.3.21.1
kubernetes1.26 SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSSAll versions1.26.15-150400.9.22.1
kubernetes1.28 SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSSAll versions1.28.13-150400.9.14.1
helm SUSE:Linux Enterprise Micro 5.5All versions3.18.3-150000.1.50.1
helm SUSE:Linux Enterprise Module for Containers 15 SP6All versions3.18.3-150000.1.50.1
kubernetes-old SUSE:Linux Enterprise Module for Containers 15 SP6All versions1.31.9-150600.13.10.1
kubernetes1.25 SUSE:Linux Enterprise Module for Containers 15 SP6All versions1.25.16-150400.9.22.1
kubernetes1.26 SUSE:Linux Enterprise Module for Containers 15 SP6All versions1.26.15-150400.9.22.1
kubernetes1.27 SUSE:Linux Enterprise Module for Containers 15 SP6All versions1.27.16-150400.9.16.1
kubernetes1.28 SUSE:Linux Enterprise Module for Containers 15 SP6All versions1.28.13-150400.9.14.1
kubernetes1.28 SUSE:Linux Enterprise Module for Containers 15 SP6All versions1.28.13-150400.9.14.1
helm SUSE:Linux Enterprise Module for Containers 15 SP7All versions3.18.3-150000.1.50.1
kubernetes-old SUSE:Linux Enterprise Module for Containers 15 SP7All versions1.31.9-150600.13.10.1
helm SUSE:Linux Enterprise Module for Package Hub 15 SP6All versions3.18.3-150000.1.50.1
helm SUSE:Linux Enterprise Module for Package Hub 15 SP7All versions3.18.3-150000.1.50.1
docker SUSE:Linux Enterprise Server 12 SP5-LTSSAll versions28.2.2_ce-98.134.1
kubernetes1.26 SUSE:Linux Enterprise Server 15 SP4-LTSSAll versions1.26.15-150400.9.22.1
kubernetes1.28 SUSE:Linux Enterprise Server 15 SP4-LTSSAll versions1.28.13-150400.9.14.1
kubernetes1.23 SUSE:Linux Enterprise Server 15 SP5-LTSSAll versions1.23.17-150500.3.21.1
kubernetes1.26 SUSE:Linux Enterprise Server 15 SP5-LTSSAll versions1.26.15-150400.9.22.1
kubernetes1.28 SUSE:Linux Enterprise Server 15 SP5-LTSSAll versions1.28.13-150400.9.14.1
docker SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5All versions28.2.2_ce-98.134.1
kubernetes1.26 SUSE:Linux Enterprise Server for SAP Applications 15 SP4All versions1.26.15-150400.9.22.1
kubernetes1.28 SUSE:Linux Enterprise Server for SAP Applications 15 SP4All versions1.28.13-150400.9.14.1
kubernetes1.23 SUSE:Linux Enterprise Server for SAP Applications 15 SP5All versions1.23.17-150500.3.21.1
kubernetes1.26 SUSE:Linux Enterprise Server for SAP Applications 15 SP5All versions1.26.15-150400.9.22.1
kubernetes1.28 SUSE:Linux Enterprise Server for SAP Applications 15 SP5All versions1.28.13-150400.9.14.1
docker SUSE:Linux Micro 6.0All versions28.3.2_ce-5.1
docker SUSE:Linux Micro 6.1All versions28.3.2_ce-slfo.1.1_5.1
helm SUSE:Linux Micro 6.1All versions3.18.3-slfo.1.1_1.1

How do I fix CVE-2025-22872?

Upgrade golang.org/x/net to 0.38.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-2025-22872 being exploited?

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

Sources

Also known as AZL-60447, AZL-60450, AZL-60458, AZL-60459, AZL-60467, AZL-60472 and 228 more.

Is CVE-2025-22872 in your software?

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

Check your SBOMs for free