Intel

AIKIDO-2026-11156

dompurify is vulnerable to Cross-Site Scripting (XSS)

Cross-Site Scripting (XSS)GHSA-gvmj-g25r-r7wr Published Yesterday

26

Low Risk

This Affects:

JSdompurify
3.0.0 - 3.4.7
Fixed in 3.4.8
Are you affected? Scan for Free

TL;DR

When DOMPurify.sanitize runs with SAFE_FOR_TEMPLATES together with RETURN_DOM, RETURN_DOM_FRAGMENT, or IN_PLACE, attacker HTML inside a template element can keep split template-literal, mustache, or ERB fragments in template.content. The final _scrubTemplateExpressions pass never entered template.content, so adjacent text nodes that only form expressions after normalization could survive. Downstream template evaluation or normalization can then execute the recovered expression as script. The fix recurses _scrubTemplateExpressions into each template.content, mirroring shadow-DOM traversal.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and sanitize attacker-controlled HTML with SAFE_FOR_TEMPLATES enabled together with RETURN_DOM, RETURN_DOM_FRAGMENT, or IN_PLACE.

Background info

dompurify is vulnerable to Cross-Site Scripting (XSS) in versions 3.0.0 - 3.4.7.

How to fix this

Upgrade the dompurify library to the patch version.