dompurify is vulnerable to Cross-Site Scripting (XSS)
26
Low Risk
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.
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.
dompurify is vulnerable to Cross-Site Scripting (XSS) in versions 3.0.0 - 3.4.7.
Upgrade the dompurify library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

SOC 2Compliant
ISO 27001Compliant