Cross-site scripting in DOMPurify - #VU166238
Published: November 16, 2026
Vulnerability details
The vulnerability allows a remote attacker to execute arbitrary JavaScript in a victim's browser through client-side template injection.
The vulnerability exists due to improper neutralization of template expressions in DOMPurify's SAFE_FOR_TEMPLATES processing when sanitized output is reparsed through innerHTML and compiled by a template engine, allowing nested forms or orphaned end tags to reassemble expressions. A remote attacker can submit markup such as <form><div>{</form><form>{constructor.constructor('alert(1)')()}</form>} or <b><i>}<x></x>}{</i>{constructor.constructor('alert(1)')()}</b>} to execute JavaScript in the page's origin.