Intel

AIKIDO-2026-925458

dompurify is vulnerable to Cross-Site Scripting (XSS)

CVE-2026-75838Published Aug 5, 2026
August 5, 2026

31

CVE Score

Low

Cross-Site Scripting (XSS)

Are you affected? Scan for Free

TL;DR

DOMPurify can sanitize existing DOM nodes in place when the IN_PLACE option is enabled. When a sanitization hook removes a containing element, the sanitizer returns early without neutralizing that element's now-detached descendants, so a descendant such as an image keeps an already-armed event handler. The returned root looks clean, but the retained handler still runs after sanitize() returns once the pending resource event fires. The fix neutralizes the detached subtree before returning from the hook-removal path so queued handlers are stripped.

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 use IN_PLACE sanitization together with a hook that removes a containing element, so that untrusted HTML with a resource element (for example an img with an onload/onerror handler) can retain an executable handler on the detached subtree.

Package

Versions

0.0.1 - 3.4.12

Fixed in 3.4.13

Background info

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

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