Cross-site scripting in DOMPurify - #VU166238

 

Cross-site scripting in DOMPurify - #VU166238

Published: November 16, 2026


Vulnerability identifier: #VU166238
CSH Severity: Medium
CVSS v4: 5.1 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N]
CVE-ID: N/A
CWE-ID: CWE-79
Exploitation vector: Remote access
Exploit availability: No public exploit available

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.


Affected software

DOMPurify

Remediation

Install security update from vendor's website.

DOMPurify - update to 3.4.18

External References

Related Security Bulletins