Cross-site scripting in DOMPurify - CVE-2026-0540
Published: June 29, 2026
DOMPurify
Detailed vulnerability description
The disclosed vulnerability allows a remote attacker to perform cross-site scripting (XSS) attacks.
The vulnerability exists due to insufficient sanitization of user-supplied data. The vulnerability allows attackers to bypass attribute sanitization by exploiting five missing rawtext elements (noscript, xmp, noembed, noframes, iframe) in the SAFE_FOR_XML regex.
Successful exploitation of this vulnerability may allow a remote attacker to steal potentially sensitive information, change appearance of the web page, perform phishing and drive-by-download attacks.
How to mitigate CVE-2026-0540
Sources
- https://fluidattacks.com/advisories/daft
- https://github.com/cure53/DOMPurify
- https://github.com/cure53/DOMPurify/commit/302b51de22535cc90235472c52e3401bedd46f80
- https://github.com/cure53/DOMPurify/releases/tag/3.3.2
- https://www.vulncheck.com/advisories/dompurify-xss-via-missing-rawtext-elements-in-safe-for-xml