npm
CVE-2026-140391
DOMPurify before 3.4.18 SAFE_FOR_TEMPLATES Bypass Leading to XSS
- Severity
- Medium 5.1
- Published
- 1 Dec 2026
- Last changed
- 1 Dec 2026
- Added to UpHeron
- 1 Dec 2026
- Fixed in
- 3.4.18
- Weakness
- Cross-site scripting (CWE-79)
- Attack
- Over the network · No login needed · Needs someone to click or open something
- CVSS vector
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- Sources
- CVE Program
Description
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.
Affected software
| Software | Affected versions |
|---|---|
dompurifynpm · osv:npm:dompurify |
|
About dompurify
- Weekly downloads (npm)
- 98,025,240npm, 29 Nov 2026
Vulnerabilities in dompurify
- In our list
- 4
- Published in the last 12 months
- 4
- Critical, last 12 months
- 0
- High, last 12 months
- 0
- Known exploited
- 0
- CVE-2026-116804DOMPurify SAFE_FOR_TEMPLATES bypass: split template expressions survive in attached shadow root content on DOM output modesMedium 5.1 22 Oct 2026
- CVE-2026-116803DOMPurify IN_PLACE: hook that removes a parent or sibling leaves the detached subtree's event handlers armed (incomplete fix for GHSA-p98j-92pf-mc4p)Medium 5.1 22 Oct 2026
- CVE-2026-116802DOMPurify: SMIL attributeName=href guard is skipped when PARSER_MEDIA_TYPE is application/xhtml+xmlMedium 5.1 22 Oct 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-140391