CVE-2026-0540: DOMPurify XSS via Missing Rawtext Elements in SAFE_FOR_XML
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 Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2026-0540?
CVE-2026-0540 is classified as a high severity vulnerability due to its potential to allow cross-site scripting attacks.
How do I fix CVE-2026-0540?
To fix CVE-2026-0540, upgrade DOMPurify to version 3.3.1 or higher, or 2.5.8 or higher.
Which versions of DOMPurify are affected by CVE-2026-0540?
CVE-2026-0540 affects DOMPurify versions 3.1.3 through 3.3.1 and 2.5.3 through 2.5.8.
What type of vulnerability is CVE-2026-0540?
CVE-2026-0540 is a cross-site scripting (XSS) vulnerability.
Who is the vendor of the affected software in CVE-2026-0540?
The vendor of the affected software in CVE-2026-0540 is Cure53, which develops DOMPurify.