CVE-2026-144292: CVE-2026-144292: Client-Side Template Injection and Cross-Site Scripting in DOMPurify via SAFE_FOR_TEMPLATES…
CVE-2026-144292: Client-Side Template Injection and Cross-Site Scripting in DOMPurify via SAFE_FOR_TEMPLATES Bypass Vulnerability ID: CVE-2026-144292 CVSS Score: 7.6 Published: 2026-12-03 DOMPurify prior to version
CVE-2026-144292: Client-Side Template Injection and Cross-Site Scripting in DOMPurify via SAFE_FOR_TEMPLATES Bypass
Vulnerability ID: CVE-2026-144292
CVSS Score: 7.6
Published: 2026-12-03
DOMPurify prior to version 3.5.0 contains a sanitization bypass in the SAFE_FOR_TEMPLATES configuration mode. By embedding split template expression delimiters across invalid nested
elements, an attacker can evade character data scrubbing during initial sanitization. When the sanitized markup is subsequently re-parsed into the DOM via innerHTML, browser HTML5 parsing rules strip the nested tags and concatenate the split text nodes, reconstructing executable template expressions that trigger Cross-Site Scripting (XSS) in client-side template engines.TL;DR
A flaw in DOMPurify prior to 3.5.0 allows attackers to bypass the SAFE_FOR_TEMPLATES option using nested tags that split template delimiters across text nodes. Upon re-parsing via innerHTML, the browser drops the invalid form tags and joins the delimiters, enabling Client-Side Template Injection and arbitrary JavaScript execution.
⚠️ Exploit Status: POC
Technical Details
- CVE ID: CVE-2026-144292 (GHSA-hrxw-jjj6-2g2j)
- CWE Classification: CWE-79 (Cross-site Scripting) / CWE-1336 (Template Injection)
- CVSS v4.0 Score: 7.6 High (CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N)
- Attack Vector: Network (Unauthenticated HTML input with SAFE_FOR_TEMPLATES enabled)
- Affected Versions: DOMPurify < 3.5.0
- Patched Version: DOMPurify 3.5.0
- Impact: Client-Side Template Injection & Arbitrary JavaScript Execution (XSS)
- Exploit & KEV Status: Public PoC Available / Not Listed in CISA KEV
Affected Systems
- cure53/DOMPurify (< 3.5.0)
-
DOMPurify: < 3.5.0 (Fixed in:
3.5.0)
Code Analysis
Commit: d05b243
Fix SAFE_FOR_TEMPLATES bypass via nested form tags and table foster-parenting (PR #1744)
Exploit Details
- GitHub: Official regression tests in test/test-suite.js demonstrating SAFE_FOR_TEMPLATES bypass via nested form tags and table foster-parenting.
Mitigation Strategies
- Upgrade DOMPurify to version 3.5.0 or newer to enable cross-node boundary checking and table foster-parenting normalization during SAFE_FOR_TEMPLATES scrubbing.
- Exclude DOM containers that render untrusted HTML from client-side template compilation using framework-specific directives such as ng-non-bindable (AngularJS), v-pre (Vue.js), or x-ignore (Alpine.js).
- Use RETURN_DOM: true or RETURN_DOM_FRAGMENT: true with appendChild() instead of assigning serialized HTML strings to innerHTML, eliminating the secondary HTML parsing pass.
- Restrict or forbid and tags via FORBID_TAGS in DOMPurify configurations when user inputs do not require form or table markup.
Remediation Steps:
- Audit package.json and lockfiles (package-lock.json, yarn.lock, pnpm-lock.yaml) to identify all direct and transitive dependencies on dompurify < 3.5.0.
- Run 'npm install dompurify@^3.5.0' (or equivalent package manager command) to update the library to the patched release.
- Review all calls to DOMPurify.sanitize() that enable SAFE_FOR_TEMPLATES: true and verify whether the output is passed into template-compiled DOM subtrees.
- Add non-bindable directives (v-pre, ng-non-bindable) to target DOM containers rendering sanitized user content as a defense-in-depth control.
References
- GitHub Security Advisory GHSA-hrxw-jjj6-2g2j
- DOMPurify Fix Commit d05b24333a25f6f2e949493749523563f15230e2
- DOMPurify Pull Request #1744
- DOMPurify Release 3.5.0
- National Vulnerability Database (NVD) - CVE-2026-144292
- CVE.org Record - CVE-2026-144292
- CVEProject cvelistV5 Official JSON Record
Read the full report for CVE-2026-144292 on our website for more details including interactive diagrams and full exploit analysis.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.