CVE-2026-144292: DOMPurify SAFE_FOR_TEMPLATES bypass: nested <form> makes a template expression reassemble when sanitized output is reparsed

Published Dec 3, 2026
·
Updated

DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Prior to 3.5.0, DOMPurify.sanitize() with SAFEFORTEMPLATES can return attacker-controlled markup whose brace fragments remain separated during sanitization but become adjacent when nested form elements are reparsed through innerHTML. A template engine that compiles the reparsed DOM can evaluate the reconstructed expression, allowing arbitrary JavaScript execution in the page origin. Plain unsplit template expressions remain scrubbed, and exploitation requires the sanitized output to be reparsed and compiled by a template engine. This issue is fixed in version 3.5.0.

Affected Software

1 affected component
npm/dompurify<3.5.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade DOMPurify to a version that resolves this vulnerability.

    Fixed in 3.5.0

Event History

Dec 3, 2026
CVE Published
via MITRE·05:21 PM
Data Sourced
via MITRE·05:21 PM
DescriptionWeakness

Frequently Asked Questions

1

Which applications are realistically exposed to this issue?

Applications using DOMPurify versions before 3.5.0 with SAFE_FOR_TEMPLATES enabled are exposed only if they subsequently reparse sanitized output through innerHTML and compile that reparsed DOM with a template engine. Applications that do not perform that reparse-and-compile flow are not described as affected.

2

What must an attacker control for exploitation?

An attacker must be able to supply markup that survives sanitization with template-expression brace fragments separated, then causes those fragments to become adjacent after nested form elements are reparsed. The resulting reconstructed expression must be processed by a template engine capable of evaluating it.

3

Are ordinary template expressions removed by SAFE_FOR_TEMPLATES vulnerable?

No. Plain, unsplit template expressions remain scrubbed; the bypass depends on fragments being reassembled during reparsing.

4

What should be done to remediate the issue?

Upgrade DOMPurify to version 3.5.0. If upgrading is not immediately possible, avoid reparsing sanitized output through innerHTML before it is compiled by a template engine.

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