Intel

AIKIDO-2026-904917

dompurify is vulnerable to Cross-Site Scripting (XSS)

Cross-Site Scripting (XSS) Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 5 days ago

47

Medium Risk

This Affects:

JSdompurify
3.4.3 - 3.4.14
Fixed in 3.4.15
Are you affected? Scan for Free

TL;DR

When DOMPurify.sanitize receives a DocumentFragment whose child is a shadow host, it moves the fragment's children into an internal working body and leaves the fragment empty before sanitizing. The attached shadow root traversal then runs from the now empty fragment instead of the working body, so the child host's open shadow root is never scanned. Content inside that shadow root, including a javascript: URL or event handler, is returned unsanitized when a DOM fragment is requested. The fix runs the attached shadow root traversal from the working body so hosts moved out of the fragment are still sanitized.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you pass a DOM fragment that carries an attached shadow root to DOMPurify.sanitize.

Background info

dompurify is vulnerable to Cross-Site Scripting (XSS) in versions 3.4.3 - 3.4.14.

How to fix this

Upgrade the dompurify library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform