Home › CVE › JavaScript
CVE-2026-140391 — cure53 DOMPurify
Summary
DOMPurify before 3.4.18 contains a SAFE_FOR_TEMPLATES bypass that allows attackers to smuggle template expressions past sanitization using nested form elements or orphaned end tags. When the sanitized output is reparsed via innerHTML, split braces merge into live {{...}} expressions that Vue or AngularJS evaluate, executing attacker JavaScript in victims' browsers.
Severity breakdown
Medium · 5.1
An attacker without an account can exploit this over the network if a user is tricked into an action.
- Attack from
- the network (remotely)
- Attack complexity
- low (no special conditions)
- Special conditions
- none
- Login needed
- no
- User action needed
- yes, a user must deliberately do something
- Impact
- none
- Impact on other systems
- low on confidentiality and integrity, none on availability
Weakness
- CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
- CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine
Affected and fixed versions
| Product | Affected versions | Fixed in |
|---|---|---|
| dompurify (npm) | < 3.4.18 | 3.4.18 |
| cure53 DOMPurify | < 3.4.18 | 3.4.18 |
References by type
Vendor advisories
Other references
Affected
- cure53 DOMPurify
What to do
- Follow the vendor advisory and the references below for fixed versions and workarounds.
Frequently asked questions
What is CVE-2026-140391?
DOMPurify before 3.4.18 contains a SAFEFORTEMPLATES bypass that allows attackers to smuggle template expressions past sanitization using nested form elements or orphaned end tags. When the sanitized output is reparsed via innerHTML, split braces merge into live {{...}} expressions that Vue or AngularJS evaluate, executing attacker JavaScript in victims' browsers. Weakness type: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79).
How severe is CVE-2026-140391?
CVE-2026-140391 has a CVSS 4.0 base score of 5.1 (medium), from the CNA (vulncheck.com). An attacker without an account can exploit this over the network if a user is tricked into an action.
Is CVE-2026-140391 being exploited?
Not as far as is known: CVE-2026-140391 is not in CISA's Known Exploited Vulnerabilities catalog as of December 3, 2026. EPSS estimates a 0.5% chance that it is exploited in the next 30 days.
Which versions are affected by CVE-2026-140391?
dompurify (npm) < 3.4.18 (fixed in 3.4.18); cure53 DOMPurify < 3.4.18 (fixed in 3.4.18).
How do I fix CVE-2026-140391?
Update to a fixed release: dompurify (npm) 3.4.18; cure53 DOMPurify 3.4.18.