NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2026-0540: DOMPurify contains a Cross-site Scripting vulnerability

mediumCVSS 4.0 5.1 · 3.1 6.1GHSA-v2wj-7wpq-c8vv

DOMPurify 3.1.3 through 3.3.1 and 2.5.3 through 2.5.8, fixed in 2.5.9 and 3.3.2, 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 SAFEFORXML regex.

Published Mar 3, 2026 · Updated Mar 30, 2026

Affected packages

dompurify

Ecosystem
npm
Affected
>= 3.1.3, <= 3.3.1
Fixed in
3.3.2
Check
npm ls dompurify

dompurify

Ecosystem
npm
Affected
>= 2.5.3, <= 2.5.8
Fixed in
2.5.9
Check
npm ls dompurify

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

DOMPurify 3.1.3 through 3.3.1 and 2.5.3 through 2.5.8, fixed in 2.5.9 and 3.3.2, 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> in attribute values to execute JavaScript when sanitized output is placed inside these unprotected rawtext contexts.

Credited to swils23, cure53, caverav.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More npm vulnerabilities

All npm entries