Medium severity · published Mar 3, 2026
CVE-2026-0540
DOMPurify XSS via Missing Rawtext Elements in SAFE_FOR_XML
6.1
CVSS
0.4%
EPSS
No
On KEV
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.
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Confidentiality
Low
Integrity
Low
Availability
None
Scope
Changed
Exploitation
Is it being used?
Exploit prediction (EPSS)0.4% · higher than 29% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
DO
DOMPurify · cure53
3.1.3 through 3.3.1; 2.5.3 through 2.5.8 · source: vendor, NVD
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2026-0540
CVE.org
https://www.cve.org/CVERecord?id=CVE-2026-0540
fluidattacks.com
https://fluidattacks.com/advisories/daft
Product
https://github.com/cure53/DOMPurify
github.com
https://github.com/cure53/DOMPurify/commit/302b51de22535cc90235472c52e3401bedd46f80
github.com
https://github.com/cure53/DOMPurify/releases/tag/3.3.2
Third Party Advisory
https://www.vulncheck.com/advisories/dompurify-xss-via-missing-rawtext-elements-in-safe-for-xml
More from DOMPurify
9.8
CVE-2024-48910
DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG
8.2
CVE-2026-47423
DOMPurify XSS via `selectedcontent` re-clone
7.2
CVE-2026-65898
DOMPurify before 3.4.11 Permanent Attribute Allowlist Pollution via setConfig
6.9
CVE-2026-41238
DOMPurify: Prototype Pollution to XSS Bypass via CUSTOM_ELEMENT_HANDLING Fallback
6.8
CVE-2026-41239
DOMPurify has a SAFE_FOR_TEMPLATES bypass in RETURN_DOM mode
