All vulnerabilities

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.

From the CVE Program.

Affected software

SoftwareAffected versions
dompurifynpm · osv:npm:dompurify
  • Every version before 3.4.18

About dompurify

Weekly downloads (npm)
98,025,240npm, 29 Nov 2026

References

  • CVE.org https://www.cve.org/CVERecord?id=CVE-2026-140391