Vulnerability · Published Mar 3, 2026 · Assigned by VulnCheck
CVE-2026-0540DOMPurify XSS via Missing Rawtext Elements in SAFE_FOR_XML
Medium 6.1
In plain English
A medium-severity cross-site scripting in DOMPurify from cure53. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 33% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
DOMPurify 3.1.3 through 3.3.1 and 2.5.3 through 2.5.8, fixed in commit 2726c74, contain a cross-site scripting vulnerability that allows attackers to bypass attribute sanitization by exploiting five missing rawtext elements (noscript, xmp, noembed, noframes, iframe) in the SAFE_FOR_XML regex. Attackers can include payloads like </noscript><img src=x onerror=alert(1)> in attribute values to execute JavaScript when sanitized output is placed inside these unprotected rawtext contexts.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | node-dompurify | no fix listed | DEBIAN-CVE-2026-0540 |
| Debian:13 | node-dompurify | no fix listed | DEBIAN-CVE-2026-0540 |
| Debian:14 | node-dompurify | 3.3.2+dfsg-1 | DEBIAN-CVE-2026-0540 |
| Ubuntu:22.04:LTS | node-dompurify | no fix listed | UBUNTU-CVE-2026-0540 |
| Ubuntu:24.04:LTS | node-dompurify | no fix listed | UBUNTU-CVE-2026-0540 |
| Ubuntu:25.10 | node-dompurify | no fix listed | UBUNTU-CVE-2026-0540 |
| Ubuntu:26.04:LTS | node-dompurify | no fix listed | UBUNTU-CVE-2026-0540 |
| Ubuntu:26.10 | node-dompurify | no fix listed | UBUNTU-CVE-2026-0540 |
| npm | dompurify | 2.5.9 | GHSA-v2wj-7wpq-c8vv |
| npm | dompurify | 3.3.2 | GHSA-v2wj-7wpq-c8vv |
Affected products (as reported)
Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
References
- DOMPurify GitHub Repository product
- https://github.com/cure53/DOMPurify/commit/302b51de22535cc90235472c52e3401bedd46f80 patch
- VulnCheck Advisory: DOMPurify XSS via Missing Rawtext Elements in SAFE_FOR_XML release-notes
- https://fluidattacks.com/advisories/daft third-party-advisory
- https://www.vulncheck.com/advisories/dompurify-xss-via-missing-rawtext-elements-in-safe-for-xml third-party-advisory