Impact
DOMPurify is a DOM‑only cross‑site scripting sanitizer for HTML, MathML, and SVG. Prior to 3.4.6, DOMPurify.sanitize(node, { IN_PLACE: true }) accepted same‑origin foreign‑realm DOM nodes while follow‑on checks used parent‑realm constructors, causing instanceof checks for forms, named node maps, document fragments, and elements to fail and skip clobber, template‑content, and shadow‑DOM sanitization branches. The result is that executable markup could survive filtering and be executed, permitting client‑side script execution or UI manipulation. The issue is fixed in version 3.4.6, and the weakness is classified as CWE‑501, CWE‑693, and CWE‑79.
Affected Systems
The library cure53 DOMPurify prior to release 3.4.6 is affected. Any installation of DOMPurify version 3.4.5 or older, regardless of whether it is used in a server‑side rendering context or a client‑side web application, is vulnerable when the IN_PLACE option is enabled.
Risk and Exploitability
The CVSS score of 6.1 indicates moderate severity. The EPSS score of less than 1% suggests that, at present, the likelihood of exploitation is low. Because the vulnerability is not listed in the CISA KEV catalog, no known large‑scale exploitation campaigns have been documented. The likely attack vector is that an attacker injects crafted frontend content containing foreign‑realm DOM nodes into a page that uses DOMPurify.sanitize with IN_PLACE:true. If the content is processed by the library, the cross‑realm bias in instanceof checks enables the malicious markup to bypass sanitization and be executed in the victim’s context.
OpenCVE Enrichment
Github GHSA