# CVE-2026-41238: DOMPurify: Prototype Pollution to XSS Bypass via CUSTOM_ELEMENT_HANDLING Fallback

> Prototype pollution allows bypassing DOMPurify sanitization, enabling XSS attacks via injected custom elements and attributes.

- **Severity:** Medium 6.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:N`)
- **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:** Yes
- **Published:** 23 Apr 2026
- **Updated:** 23 Apr 2026
- **Also known as:** CLEANSTART-2026-AM93725, CLEANSTART-2026-NT67628, DEBIAN-CVE-2026-41238, ECHO-951f-211f-5fc7, GHSA-v9jr-rg53-9pgp, MINI-3gqp-x9f3-2wrx, MINI-483m-mfpp-6fq7, MINI-4j9r-hx2w-h7gc, MINI-6mjp-mpx7-3h6g, MINI-85m4-crvh-qj43, MINI-9qwr-h932-vr9r, MINI-9x7m-846f-xw93, MINI-c495-gp43-cgqw, MINI-hh8p-854j-whf5, MINI-jp47-f58r-r2mr, MINI-w5cm-gf9p-74gp, ROOT-APP-NPM-CVE-2026-41238, UBUNTU-CVE-2026-41238

## What is CVE-2026-41238?

CVE-2026-41238 is a medium-severity cross-site scripting vulnerability in cure53 DOMPurify, published on 23 Apr 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

DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Versions 3.0.1 through 3.3.3 are vulnerable to a prototype pollution-based XSS bypass. When an application uses `DOMPurify.sanitize()` with the default configuration (no `CUSTOM_ELEMENT_HANDLING` option), a prior prototype pollution gadget can inject permissive `tagNameCheck` and `attributeNameCheck` regex values into `Object.prototype`, causing DOMPurify to allow arbitrary custom elements with arbitrary attributes — including event handlers — through sanitization. Version 3.4.0 fixes the issue.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation), CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes)

## Which versions are affected by CVE-2026-41238?

2 open source packages ship an affected version, including dompurify.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `dompurify` | npm | From 3.0.1 | 3.4.0 |
| `dompurify` | npm | From 3.0.1 | 3.4.0 |

## How do I fix CVE-2026-41238?

Upgrade dompurify to 3.4.0 or later.

## Is CVE-2026-41238 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-41238 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-41238 and fix it if it is affected.

What it is: CVE-2026-41238 is a medium-severity cross-site scripting vulnerability in cure53 DOMPurify, published on 23 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-41238 exists.

Affected packages and fixed versions:
- dompurify (npm): affected from 3.0.1; fixed in 3.4.0
- dompurify (npm): affected from 3.0.1; fixed in 3.4.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-2026-41238/ (Markdown: https://insights.sbomify.com/CVE-2026-41238/index.md)
```

## Sources

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

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