DOMPurify SAFE_FOR_TEMPLATES bypass: nested <form> makes a template expression reassemble when sanitized output is reparsed
- CVE-2026-144292
- GHSA-hrxw-jjj6-2g2j
- EUVD-2026-143510
Description
DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Prior to 3.5.0, DOMPurify.sanitize() with SAFE_FOR_TEMPLATES can return attacker-controlled markup whose brace fragments remain separated during sanitization but become adjacent when nested form elements are reparsed through innerHTML. A template engine that compiles the reparsed DOM can evaluate the reconstructed expression, allowing arbitrary JavaScript execution in the page origin. Plain unsplit template expressions remain scrubbed, and exploitation requires the sanitized output to be reparsed and compiled by a template engine. This issue is fixed in version 3.5.0.
Text from the CVE.org record.
Recommendation
dompurify
- If you run a version before 3.5.0update to 3.5.0 or laterdompurify 3.5.0 on its registry (opens in a new tab)
Taken from the version ranges the sources state. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.
Affected
cure53 DOMPurify
Affected versions Fixed in < 3.5.0 none stated dompurifynpm
Affected versions Fixed in before 3.5.0 3.5.0
Product versions from the CVE.org record.
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.