CVE-2026-41239 DOMPurify has a SAFE_FOR_TEMPLATES bypass in RETURN_DOM mode
DOMPurify fails to strip template expressions in RETURN_DOM mode, allowing XSS attacks in applications using template-evaluating frameworks like Vue 2.
- 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-41239?
CVE-2026-41239 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. Starting in version 1.0.10 and prior to version 3.4.0, `SAFE_FOR_TEMPLATES` strips `{{...}}` expressions from untrusted HTML. This works in string mode but not with `RETURN_DOM` or `RETURN_DOM_FRAGMENT`, allowing XSS via template-evaluating frameworks like Vue 2. Version 3.4.0 patches the issue.
Which versions are affected by CVE-2026-41239?
2 open source packages ship an affected version, including dompurify.
| Package | Affected | Fixed in |
|---|---|---|
dompurify npm | From 1.0.10 | 3.4.0 |
dompurify npm | From 1.0.10 | 3.4.0 |
How do I fix CVE-2026-41239?
Upgrade dompurify to 3.4.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-41239 being exploited?
There is no known exploitation of CVE-2026-41239 in the wild and no public exploit code.
Sources
Also known as CLEANSTART-2026-EP14815, CLEANSTART-2026-JJ46339, DEBIAN-CVE-2026-41239, ECHO-89aa-7e3b-59e1, GHSA-crv5-9vww-q3g8, MINI-2vfm-vhq6-pvrj and 12 more.