DOMPurify IN_PLACE: hook that removes a parent or sibling leaves the detached subtree's event handlers armed
Affects dompurifySource GCVE Database
CVSS 2.3 Low : upgrade to 3.4.17 when convenient.
Data as of 19 Nov 2026, 00:51 UTC
- 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:NWhat to do
Upgrade dompurify to 3.4.17.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npmdompurify | Affected
| Fixed in
|
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
- github.com/cure53/DOMPurify/security/advisories/GHSA-mrv2-3pqr-j5jr (opens in a new tab)
- github.com/cure53/DOMPurify/pull/1672 (opens in a new tab)
- github.com/cure53/DOMPurify/commit/a77a3e78b59f72fa4d1c83f22e121ad9cc7d3575 (opens in a new tab)
- github.com/cure53/DOMPurify (opens in a new tab)
- github.com/cure53/DOMPurify/releases/tag/3.4.17 (opens in a new tab)