Skip to main content
VulnerabilityPublished Updated

DOMPurify IN_PLACE: hook that removes a parent or sibling leaves the detached subtree's event handlers armed

Affects dompurifySource GCVE Database

0

CVSS 2.3 Low : upgrade to 3.4.17 when convenient.

Data as of 19 Nov 2026, 00:51 UTC

CVSS 4.0 base score
2.3Low
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 3.4.17
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

What to do

Upgrade dompurify to 3.4.17.

Affected software

ProductAffectedFixed in
npmdompurifyAffected
  • <3.4.17
Fixed in
  • 3.4.17

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A patch is available in DOMPurify version 3.4.17 that fixes this issue by properly neutralizing detached subtrees even when the removed node is not the hook's own node. Users should upgrade to version 3.4.17 or later to mitigate this vulnerability. No additional action is required if the application does not use IN_PLACE mode with hooks that remove parent or sibling nodes.

Description

DOMPurify versions prior to 3.4.17 have a vulnerability in the IN_PLACE sanitization mode where hooks that remove a parent or sibling node leave detached subtrees with active event handlers unneutralized. This allows event handlers such as <img onerror> to fire after sanitize() returns, potentially leading to DOM-based XSS. The issue arises because the sanitization process only neutralizes the node directly removed by the hook, not other detached nodes like parents or siblings. This behavior breaks the expected guarantee that detached subtrees are neutralized inline in IN_PLACE mode.

References

Community reviews

Loading reviews…