CVE-2026-0540: DOMPurify XSS via Missing Rawtext Elements in SAFE_FOR_XML

Published Mar 3, 2026
·
Updated

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

3 affected components
npm/dompurify>=3.1.3<=3.3.1, >=2.5.3<=2.5.8
Cure53 DOMPurify>=2.5.3<=2.5.8
Cure53 DOMPurify>=3.1.3<=3.3.1

Event History

Mar 3, 2026
CVE Published
via MITRE·05:26 PM
Data Sourced
via MITRE·05:26 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:16 PM
DescriptionSeverityWeaknessAffected Software
May 14, 58200
Event
via NVD·09:33 AM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

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.

2

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.

3

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.

4

What type of vulnerability is CVE-2026-0540?

CVE-2026-0540 is a cross-site scripting (XSS) vulnerability.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203