CVE-2025-22872 Incorrect Neutralization of Input During Web Page Generation in x/net in golang.org/x/net
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.
| Package | Affected | Fixed in |
|---|---|---|
golang.org/x/net Go | All versions | 0.38.0 |
golang.org/x/net Go | All versions | 0.38.0 |
golang.org/x/net Go | All versions | 0.38.0 |
Linux distribution packages (37)
kubernetes1.26 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 1.26.15-150400.9.22.1 |
kubernetes1.28 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 1.28.13-150400.9.14.1 |
kubernetes1.26 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 1.26.15-150400.9.22.1 |
kubernetes1.28 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 1.28.13-150400.9.14.1 |
kubernetes1.23 SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | All versions | 1.23.17-150500.3.21.1 |
kubernetes1.26 SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | All versions | 1.26.15-150400.9.22.1 |
kubernetes1.28 SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | All versions | 1.28.13-150400.9.14.1 |
kubernetes1.23 SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | All versions | 1.23.17-150500.3.21.1 |
kubernetes1.26 SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | All versions | 1.26.15-150400.9.22.1 |
kubernetes1.28 SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | All versions | 1.28.13-150400.9.14.1 |
helm SUSE:Linux Enterprise Micro 5.5 | All versions | 3.18.3-150000.1.50.1 |
helm SUSE:Linux Enterprise Module for Containers 15 SP6 | All versions | 3.18.3-150000.1.50.1 |
kubernetes-old SUSE:Linux Enterprise Module for Containers 15 SP6 | All versions | 1.31.9-150600.13.10.1 |
kubernetes1.25 SUSE:Linux Enterprise Module for Containers 15 SP6 | All versions | 1.25.16-150400.9.22.1 |
kubernetes1.26 SUSE:Linux Enterprise Module for Containers 15 SP6 | All versions | 1.26.15-150400.9.22.1 |
kubernetes1.27 SUSE:Linux Enterprise Module for Containers 15 SP6 | All versions | 1.27.16-150400.9.16.1 |
kubernetes1.28 SUSE:Linux Enterprise Module for Containers 15 SP6 | All versions | 1.28.13-150400.9.14.1 |
kubernetes1.28 SUSE:Linux Enterprise Module for Containers 15 SP6 | All versions | 1.28.13-150400.9.14.1 |
helm SUSE:Linux Enterprise Module for Containers 15 SP7 | All versions | 3.18.3-150000.1.50.1 |
kubernetes-old SUSE:Linux Enterprise Module for Containers 15 SP7 | All versions | 1.31.9-150600.13.10.1 |
helm SUSE:Linux Enterprise Module for Package Hub 15 SP6 | All versions | 3.18.3-150000.1.50.1 |
helm SUSE:Linux Enterprise Module for Package Hub 15 SP7 | All versions | 3.18.3-150000.1.50.1 |
docker SUSE:Linux Enterprise Server 12 SP5-LTSS | All versions | 28.2.2_ce-98.134.1 |
kubernetes1.26 SUSE:Linux Enterprise Server 15 SP4-LTSS | All versions | 1.26.15-150400.9.22.1 |
kubernetes1.28 SUSE:Linux Enterprise Server 15 SP4-LTSS | All versions | 1.28.13-150400.9.14.1 |
kubernetes1.23 SUSE:Linux Enterprise Server 15 SP5-LTSS | All versions | 1.23.17-150500.3.21.1 |
kubernetes1.26 SUSE:Linux Enterprise Server 15 SP5-LTSS | All versions | 1.26.15-150400.9.22.1 |
kubernetes1.28 SUSE:Linux Enterprise Server 15 SP5-LTSS | All versions | 1.28.13-150400.9.14.1 |
docker SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 | All versions | 28.2.2_ce-98.134.1 |
kubernetes1.26 SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | All versions | 1.26.15-150400.9.22.1 |
kubernetes1.28 SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | All versions | 1.28.13-150400.9.14.1 |
kubernetes1.23 SUSE:Linux Enterprise Server for SAP Applications 15 SP5 | All versions | 1.23.17-150500.3.21.1 |
kubernetes1.26 SUSE:Linux Enterprise Server for SAP Applications 15 SP5 | All versions | 1.26.15-150400.9.22.1 |
kubernetes1.28 SUSE:Linux Enterprise Server for SAP Applications 15 SP5 | All versions | 1.28.13-150400.9.14.1 |
docker SUSE:Linux Micro 6.0 | All versions | 28.3.2_ce-5.1 |
docker SUSE:Linux Micro 6.1 | All versions | 28.3.2_ce-slfo.1.1_5.1 |
helm SUSE:Linux Micro 6.1 | All versions | 3.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.