All vulnerabilities

npm

CVE-2026-116803

DOMPurify IN_PLACE: hook that removes a parent or sibling leaves the detached subtree's event handlers armed (incomplete fix for GHSA-p98j-92pf-mc4p)

Severity
High
Published
22 Oct 2026
Last changed
27 Oct 2026
Added to UpHeron
23 Oct 2026
Fixed in
3.4.17
Exploit chance
0.2% in the next 30 daysHigher than 5% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Protection mechanism failure (CWE-693)Cross-site scripting (CWE-79)
Also known as
GHSA-mrv2-3pqr-j5jr
Sources
OSV.dev and GitHub

Description

The 3.4.16 fix for GHSA-p98j-92pf-mc4p only covers a hook that removes the node it was called for. If an IN_PLACE hook removes a different node, like the current node's parent or a sibling that has not been visited yet, that subtree is never walked or neutralized. Event handlers in it stay on the elements, and an that was already loading fires after sanitize()` returns.

The README says: "Nodes that a hook detaches from the tree ... are treated as removed. In IN_PLACE mode their subtree is neutralized inline, so an that was already loading when you built the live tree cannot fire after sanitize()` returns." That does not hold when the detached node is not the hook's own node.

src/purify.ts line 2134 (dist/purify.cjs.js line 2009 in 3.4.16), _handleHookDetachedNode():

It only checks whether currentNode lost its parent. When a hook removes currentNode.parentNode (or any ancestor), currentNode still has a parent, so nothing happens.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
dompurifynpm · osv:npm:dompurify
  • Every version before 3.4.17

About dompurify

Weekly downloads (npm)
100,045,636npm, 15 Nov 2026

References