Intel

AIKIDO-2026-760928

dompurify is vulnerable to Cross-Site Scripting (XSS)

GHSA-cg2g-xh64-v4q7Published Oct 19, 2026
October 19, 2026

31

CVE Score

Low

Cross-Site Scripting (XSS)

Are you affected? Scan for Free

TL;DR

After the walk, DOMPurify's _scrubTemplateExpressions step merges adjacent text nodes and strips template expressions that only form after that merge, but the step does not run inside attached shadow roots. With SAFE_FOR_TEMPLATES combined with RETURN_DOM, RETURN_DOM_FRAGMENT, or IN_PLACE, a template expression split across text nodes by a disallowed element inside a shadow root is joined again once that element is removed, and that expression remains in the shadow root's serialized text content, so a downstream template engine that reads that content can run the untrusted input. The fix runs that scrub on shadow root content, including nested shadow roots and templates inside them.

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 combine SAFE_FOR_TEMPLATES: true with RETURN_DOM, RETURN_DOM_FRAGMENT, or IN_PLACE on a node that carries an attached shadow root.

Package

Versions

3.4.4 - 3.4.16

Fixed in 3.4.17

Background info

dompurify is vulnerable to Cross-Site Scripting (XSS) in versions 3.4.4 - 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