Intel

AIKIDO-2026-580831

dompurify is vulnerable to Cross-Site Scripting (XSS)

GHSA-mrv2-3pqr-j5jrPublished Oct 19, 2026
October 19, 2026

31

CVE Score

Low

Cross-Site Scripting (XSS)

Are you affected? Scan for Free

TL;DR

DOMPurify's _handleHookDetachedNode only neutralizes a subtree when a hook detaches its current node from the live tree. When a hook detaches that node's parent or an unvisited sibling, the walk skips that subtree and does not add it to DOMPurify.removed, so its original event handlers can still run. An <img onerror> that is already loading when a hook removes an ancestor or sibling can still run after sanitize() returns, an incomplete fix for the detached node hardening added for GHSA-p98j-92pf-mc4p. The fix neutralizes parent and sibling removals the same way.

How do I fix this?

Upgrade the dompurify library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you run DOMPurify in IN_PLACE mode with a hook that can detach a node other than the one the hook was called for.

Package

Versions

0.0.1 - 3.4.16

Fixed in 3.4.17

Background info

dompurify is vulnerable to Cross-Site Scripting (XSS) in versions 0.0.1 - 3.4.16.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea