CVE-2026-140391: DOMPurify before 3.4.18 SAFE_FOR_TEMPLATES Bypass Leading to XSS

Published Dec 1, 2026
·
Updated

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.

Affected Software

1 affected component
npm/dompurify<3.4.18

Event History

Dec 1, 2026
CVE Published
via MITRE·02:29 PM
Data Sourced
via MITRE·02:29 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:18 PM
DescriptionSeverityWeakness
Event
via NVD·03:18 PM

Frequently Asked Questions

1

Which applications are exposed to exploitation?

Applications using DOMPurify before 3.4.18 are exposed when they use SAFE_FOR_TEMPLATES, insert sanitized attacker-controlled output through innerHTML, and subsequently allow Vue or AngularJS to process that output.

2

What does an attacker need to exploit this issue?

An attacker needs a way to supply markup that reaches DOMPurify sanitization. They can use nested form elements or orphaned end tags to cause split braces to merge into a live {{...}} template expression after innerHTML reparses the sanitized output.

3

Is user interaction required?

Yes. The supplied vector indicates user interaction is required, and successful exploitation results in attacker JavaScript executing in a victim's browser.

4

What version should be used to remediate the issue?

Upgrade DOMPurify to version 3.4.18 or later. The issue affects versions before 3.4.18.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203