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

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 16 Apr 2025
- **Updated:** 16 May 2025
- **Also known as:** AZL-60447, AZL-60450, AZL-60458, AZL-60459, AZL-60467, AZL-60472, AZL-60474, AZL-60479, AZL-60485, AZL-60486, AZL-60492, AZL-60502, AZL-60505, AZL-60510, AZL-60523, AZL-60528, AZL-60534, AZL-60537, AZL-60542, AZL-60545, AZL-60550, AZL-60554, AZL-60557, AZL-60565, AZL-60568, AZL-60572, AZL-60573, AZL-60580, AZL-60586, AZL-60588, AZL-60595, AZL-60601, AZL-60604, AZL-61750, AZL-61762, AZL-61812, AZL-64185, AZL-65664, AZL-65667, CLEANSTART-2026-GQ95457, CLEANSTART-2026-GT85159, CLEANSTART-2026-KJ71172, CLEANSTART-2026-OA69516, CLEANSTART-2026-OR73025, CLEANSTART-2026-TM97925, DEBIAN-CVE-2025-22872, ECHO-d4e9-4005-da7c, GHSA-vvgc-356p-c3xw, GO-2025-3595, MINI-2262-f3f4-rr67, MINI-229r-pr36-4phq, MINI-2444-jqr8-cjqf, MINI-26m2-4985-849v, MINI-28qx-pp8g-jrmw, MINI-2p8x-vv69-987m, MINI-2qmv-wg5x-hw9q, MINI-3pgg-hvhj-v94j, MINI-3qg7-frm4-66r5, MINI-3rj9-c28p-jgp7, MINI-3v48-v4m5-h448, MINI-4282-c2j5-pv6g, MINI-442x-xv9m-2x9x, MINI-49ff-rvv3-9pj2, MINI-4cx6-j564-f82p, MINI-4rm9-jpf9-qp46, MINI-4w9r-q64m-cccm, MINI-4ww2-frwv-xj7x, MINI-5564-rcv3-7w3w, MINI-5c4c-q5rm-vv8v, MINI-5ghq-3fvh-m4p8, MINI-5wmv-624h-345f, MINI-62h9-wrjp-79x7, MINI-659j-px9h-j448, MINI-6752-xvf4-9x9x, MINI-6cjj-qr5h-76fv, MINI-6fhx-qm6p-3qxg, MINI-6m6r-923f-q8v2, MINI-6rvh-x6p2-2xjf, MINI-6v9v-qcg9-fvx9, MINI-72xc-8p94-w337, MINI-72xj-frrp-3w65, MINI-733q-f82c-mvj7, MINI-772w-fqqm-jp4f, MINI-77gx-gwxw-5fhj, MINI-844j-q5m4-97jf, MINI-8h3v-vw24-qwqm, MINI-8hqx-8jm7-9vcj, MINI-8pp9-g4w9-grg3, MINI-8qhp-8534-j58p, MINI-8rpq-9pvq-924m, MINI-8v6g-jfwm-r5ph, MINI-8w3f-x57q-9ww3, MINI-8wqh-8r4v-7pq6, MINI-93v6-55x3-gwgv, MINI-95wm-p69x-pm2x, MINI-965g-4pw5-6573, MINI-9p8j-mxc6-hhww, MINI-9qjx-866w-mq9r, MINI-9v54-v5w2-934c, MINI-9vf4-4r52-p626, MINI-9x8c-h9vf-fv82, MINI-ccm5-2xm8-f9wg, MINI-cp3x-wfcp-v63r, MINI-cppg-33rx-9mw4, MINI-cxg8-x6fw-87fh, MINI-f2hh-frc2-hvc6, MINI-f5rq-f5mp-hwmr, MINI-f84f-c864-hvpw, MINI-f9v9-95hc-w767, MINI-ffw4-fhr7-vqxx, MINI-fm23-m3q7-qxm8, MINI-fq4r-56w2-x965, MINI-fr4g-8qjj-9hvf, MINI-fv7v-r89c-c6rm, MINI-g4h6-6r6j-fr3q, MINI-g53c-78r8-fw6m, MINI-g88w-hj6r-4wpx, MINI-g8fx-8vcg-cc9j, MINI-gc2c-x66x-w8h2, MINI-gmr9-9qj8-q7pg, MINI-gp6v-x7xg-wm85, MINI-grf2-83gq-c9v7, MINI-gxfv-4cxj-rj9m, MINI-h22f-q78c-fx64, MINI-h36j-9hcx-cxrm, MINI-h49q-79fq-79g6, MINI-h56g-qvc7-p385, MINI-h97q-76c5-f5x9, MINI-hgvw-xm26-4qx5, MINI-hhp9-j6wx-9rhr, MINI-hhwg-w7fw-6m98, MINI-hjf9-g4hg-7qv8, MINI-hp2v-2xfm-qqw7, MINI-hqjf-mj47-x248, MINI-hv42-3jm7-f72c, MINI-hw26-hcqx-q988, MINI-j29r-h8g2-hjjm, MINI-j2f5-6p2x-6wj8, MINI-j3r7-9pj8-4c7p, MINI-j4v6-xv84-23q7, MINI-j5vq-c6x5-gw6f, MINI-jg25-76fv-vwmw, MINI-jhj4-8pjj-rf8w, MINI-jpj7-94w2-x5x8, MINI-jrwm-r683-5xpr, MINI-jw78-xgvh-wh45, MINI-m37h-56cq-7p99, MINI-m3g6-pv39-5g8h, MINI-m5rw-ph66-g66m, MINI-m5wc-f7c9-2h4c, MINI-m78c-x4r6-73jp, MINI-m84j-xj2q-3ppp, MINI-m8hw-627c-mcjc, MINI-mhcf-p3gc-hg5w, MINI-mr7j-4gmx-qvjx, MINI-mv69-rvfr-r8wr, MINI-mvrf-wjxq-xfwf, MINI-mwfq-qc64-5pxw, MINI-p268-37g4-v9jm, MINI-p54g-m3cj-g2v3, MINI-pfm5-m5w8-2f92, MINI-pgr8-vmhm-jmjg, MINI-px64-g76c-9cpc, MINI-pxcm-cf5q-q785, MINI-q39p-prx3-jp58, MINI-q46p-g85m-2jmq, MINI-q4r5-j8hr-f5mw, MINI-qcfv-x42g-969j, MINI-qcrp-h9w2-h64r, MINI-qg95-6mg3-xg8q, MINI-qmw3-5p36-w7wr, MINI-qr8v-pc93-pr5j, MINI-qrxm-9gh4-3585, MINI-qw3p-xj5g-38g6, MINI-qw8q-x57c-5gqx, MINI-qx54-q4wh-j93c, MINI-r8rv-gcrx-3mc9, MINI-rhjc-q57r-jcv5, MINI-rj64-962q-3cfc, MINI-rwfx-m66c-r8cw, MINI-vjfq-29gv-wh7v, MINI-vm6r-qm39-mgfm, MINI-vpx9-mm7x-fhxc, MINI-vx33-43mq-vjr9, MINI-w297-4hqr-892q, MINI-w8g2-284f-8w8j, MINI-w8q8-crjq-r87p, MINI-w8v5-j33f-gp3f, MINI-wcmf-78xr-5g5j, MINI-wg4h-2jwm-65xp, MINI-whm2-vrg4-vj8j, MINI-wj4r-w4j9-9gm5, MINI-wqrf-8p8r-xf4p, MINI-wrm8-3cwr-f2jp, MINI-ww3v-4645-m68f, MINI-x6jx-p9gw-v8gx, MINI-x73x-v9pr-8c82, MINI-xc4g-83vq-cjxj, MINI-xg38-g53h-h3vg, MINI-xp9x-j46v-rrq6, MINI-xvf3-vx3f-4gg2, MINI-xw4w-r5wj-3v2m, ROOT-APP-GOBINARY-CVE-2025-22872, ROOT-OS-DEBIAN-12-CVE-2025-22872, SUSE-SU-2025:01940-1, SUSE-SU-2025:01940-2, SUSE-SU-2025:01941-1, SUSE-SU-2025:01945-1, SUSE-SU-2025:02121-1, SUSE-SU-2025:02336-1, SUSE-SU-2025:02350-1, SUSE-SU-2025:02350-2, SUSE-SU-2025:02351-1, SUSE-SU-2025:02366-1, SUSE-SU-2025:02366-2, SUSE-SU-2025:02383-1, SUSE-SU-2025:02383-2, SUSE-SU-2025:02424-1, SUSE-SU-2025:20457-1, SUSE-SU-2025:20510-1, SUSE-SU-2025:20535-1, UBUNTU-CVE-2025-22872, openSUSE-SU-2025:15008-1, openSUSE-SU-2025:15028-1, openSUSE-SU-2025:15034-1, openSUSE-SU-2025:15036-1, openSUSE-SU-2025:15046-1, openSUSE-SU-2025:15047-1, openSUSE-SU-2025:15147-1, openSUSE-SU-2025:15228-1, openSUSE-SU-2025:15234-1, openSUSE-SU-2025:15235-1, openSUSE-SU-2025:15236-1, openSUSE-SU-2025:15462-1

## 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 | Ecosystem | 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 |
| `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.

## Is CVE-2025-22872 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-22872 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2025-22872 in the wild and no public exploit code.

Affected packages and fixed versions:
- golang.org/x/net (Go): affected all versions; fixed in 0.38.0
- golang.org/x/net (Go): affected all versions; fixed in 0.38.0
- golang.org/x/net (Go): affected all versions; fixed in 0.38.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-22872/ (Markdown: https://insights.sbomify.com/CVE-2025-22872/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-22872
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-22872
- OSV: https://osv.dev/vulnerability/CVE-2025-22872

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-22872/
Summaries are generated and may contain mistakes; the official description above is the record.
