DOMPurify SAFE_FOR_TEMPLATES bypass: nested <form> makes a template expression reassemble when sanitized output is
Affects dompurifySource GCVE Database
Not known to be exploited · CVSS 7.6 High : upgrade to 3.5.0 soon.
Data as of 4 Dec 2026, 00:45 UTC
Thin evidence
One scorer or none| CNA (GitHub_M) | CVSS 4.0 | 7.6 |
|---|
- Patch
- Available – fixed in 3.5.0
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 3 Dec 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 3 Dec 2026.
What to do
Upgrade dompurify to 3.5.0.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npmdompurify | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A fix is available in DOMPurify version 3.5.0. Users should upgrade to version 3.5.0 or later to address this vulnerability. Until upgraded, avoid using the SAFE_FOR_TEMPLATES option or apply additional sanitization steps that consider the effects of re-parsing the sanitized output. The vendor suggests approaches such as removing nested <form> elements or re-parsing and re-sanitizing until stable output is achieved.
Description
DOMPurify version 3.4.18 with the SAFE_FOR_TEMPLATES option enabled has a vulnerability where nested <form> elements cause template expressions to reassemble after sanitization and re-parsing. This leads to sanitized output that appears safe but becomes a live template expression when assigned to innerHTML, enabling arbitrary JavaScript execution in template engines like Vue 3 and AngularJS 1.8.3. The issue arises because the sanitizer's checks do not account for how the output is parsed a second time by the consumer, allowing an attacker to bypass the intended protections.
References
- github.com/cure53/DOMPurify/security/advisories/GHSA-hrxw-jjj6-2g2j (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2026-144292 (opens in a new tab)
- github.com/cure53/DOMPurify/pull/1744 (opens in a new tab)
- github.com/cure53/DOMPurify/commit/d05b24333a25f6f2e949493749523563f15230e2 (opens in a new tab)
- github.com/cure53/DOMPurify (opens in a new tab)
- github.com/cure53/DOMPurify/releases/tag/3.5.0 (opens in a new tab)