Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconSubmit HTML with split template expression inside <template>
-
DeliveryKEEP_CONTENT moves child text nodes into template.content
-
ExploitNodeIterator skips template.content during _scrubTemplateExpressions pass
-
Installnode.normalize() also skips template.content
-
C2merged expression survives sanitization
-
Executeapplication passes DOM output to downstream template engine
-
Impactengine evaluates attacker-controlled expression
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires all three of the following conditions to be simultaneously true: (1) the application explicitly sets SAFE_FOR_TEMPLATES: true in its DOMPurify configuration; (2) the application uses one of the DOM output modes - RETURN_DOM: true, RETURN_DOM_FRAGMENT: true, or IN_PLACE: true - rather than the default string output; and (3) the resulting DOM output is subsequently consumed by a downstream template engine that processes expressions of the form ${...}, {{...}}, or <%...%>. The default DOMPurify string output path is explicitly confirmed unaffected. Applications using DOMPurify for standard XSS protection without these non-default flags are not vulnerable. The requirement for a specific non-default configuration combination, plus a downstream template engine in the data pipeline, substantially limits the realistic attack surface beyond what the raw CVSS vector suggests. |
| Impact | The CVSS 4.0 score of 5.1 (AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N) reflects a network-reachable attack requiring active user interaction, with impact limited to Low integrity on the subsequent system and no impact on the vulnerable component itself. This is not listed in CISA KEV and no public exploit code is cited in the available references, so exploitation probability cannot be confirmed from those signals; no EPSS score is present in the provided data. Real-world risk is substantially gated by deployment specifics: the vulnerable code path requires explicit use of both SAFE_FOR_TEMPLATES and a DOM output mode, both of which are non-default configurations. Applications using the default string output, or using SAFE_FOR_TEMPLATES without a DOM output mode, are confirmed unaffected. Despite the AC:L vector metric (which measures attacker-side conditions), the dependency on a specific server-side configuration choice narrows the realistic population considerably. The combination of a non-KEV status, no observed POC, medium CVSS 4.0 score, and non-default trigger conditions makes this a targeted remediation priority for affected deployments rather than an emergency response for the broader DOMPurify install base. |
| Exploit ScenarioDerived | An attacker submits crafted HTML containing a <template> element whose content, after DOMPurify's KEEP_CONTENT processing removes a disallowed child element, leaves adjacent text nodes that merge to form ${attacker_code}. The application collects the DOM output via RETURN_DOM and passes the resulting tree to a downstream template engine such as Angular, Handlebars, or a server-side renderer, which evaluates the surviving expression and executes attacker-controlled code in the victim's browser or server context. No public exploit code has been identified, but the GHSA advisory provides sufficient source-level detail (file paths and line numbers) for a capable attacker to construct a proof of concept. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 23, 2026
SAFE_FOR_TEMPLATES bypass in DOMPurify 3.0.0-3.4.7 allows template expressions such as ${evil}, {{evil}}, and <%evil%> to survive sanitization when DOM output modes (RETURN_DOM, RETURN_DOM_FRAGMENT, or IN_PLACE) are used alongside SAFE_FOR_TEMPLATES: true. The final normalization pass (_scrubTemplateExpressions) employs a NodeIterator that, per DOM specification, does not descend into <template>.content - a separate DocumentFragment outside the normal child-node tree - meaning split text nodes that merge into exploitable expressions inside template content are never caught. Downstream template engines receiving this output may evaluate attacker-supplied expressions, producing XSS or template injection outcomes; no public exploit is identified at time of analysis, and the string output path is explicitly confirmed unaffected.
RemediationAI
Vendor-released patch: 3.4.8. Upgrade DOMPurify to version 3.4.8 or later via npm (npm install dompurify@3.4.8 or equivalent package manager command); the fix is documented in the GHSA advisory at https://github.com/cure53/DOMPurify/security/advisories/GHSA-gvmj-g25r-r7wr. If an immediate upgrade is not feasible, the most effective targeted workaround is to switch from DOM output modes to the default string output path by removing RETURN_DOM, RETURN_DOM_FRAGMENT, or IN_PLACE from the DOMPurify configuration, as the string path is explicitly confirmed unaffected - this trade-off is that callers receiving a string rather than a DOM node must adjust downstream handling. A second workaround is to disable the SAFE_FOR_TEMPLATES flag and instead perform post-sanitization template expression stripping using a separate, purpose-built step before handing output to the template engine; however, this approach is error-prone and should not be treated as a permanent solution. Applications that do not combine both SAFE_FOR_TEMPLATES and a DOM output mode require no action.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
DOMPurify (npm: dompurify, CPE: cpe:2.3:a:cure53:dompurify:*:*:*:*:*:*:*:*) is the de facto HTML sanitization library for JavaScript front-ends. The root cause is CWE-79 (Improper Neutralization of Input During Web Page Generation). SAFE_FOR_TEMPLATES operates through two mechanisms: per-node scrubbing in _sanitizeElements (purify.ts:1403) and a final normalization pass in _scrubTemplateExpressions (purify.ts:1115-1117). The normalization pass calls node.normalize() to merge adjacent text nodes and then walks them to strip expressions that only appear post-merge. However, both the NodeIterator used for this walk and node.normalize() are specified by the DOM standard to not traverse or normalize nodes inside <template>.content, which is a detached DocumentFragment. When DOMPurify removes a disallowed element with KEEP_CONTENT: true (the default), it moves the element's text children into the parent (purify.ts:1361-1373), potentially creating adjacent text nodes inside <template>.content that together form a template expression. Since the normalization pass never reaches template.content, these merged expressions escape sanitization intact and are forwarded to downstream template engines.
Know when Dompurify gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Network-delivered XSS requiring victim interaction; scope changes because the downstream template engine context is affected beyond DOMPurify itself; no direct C/I/A impact on the vulnerable component.
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
DOMPurify versions >=3.0.0 and before 3.4.8, when configured with SAFE_FOR_TEMPLATES together with a DOM output mode (RETURN_DOM, RETURN_DOM_FRAGMENT, or IN_PLACE), fail to strip template expressions (e.g. ${evil}, {{evil}}, <%evil%>) inside <template> element content. The final normalization/scrub pass (_scrubTemplateExpressions) uses a NodeIterator and node.normalize() that do not descend into template.content, so expressions that only form after adjacent text nodes merge survive sanitization. This bypasses SAFE_FOR_TEMPLATES and can allow a downstream template engine to evaluate attacker-supplied expressions. The string output path is not affected.
Blast Radius
ecosystem impact- 6 npm packages depend on dompurify (6 direct, 0 indirect)
Ecosystem-wide dependent count for version 3.0.0.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. Rated medium severity (CVSS 6
Cure53 DOMPurify before 2.0.17 allows mutation XSS. Rated medium severity (CVSS 6.1), this vulnerability is remotely exp
DOMPurify before 2.0.1 allows XSS because of innerHTML mutation XSS (mXSS) for an SVG element or a MATH element, as demo
DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. Rated critical severity (CVSS
Mutation-XSS in DOMPurify before 3.3.2 enables JavaScript execution in victim browsers when sanitized output is re-inser
Hook mutation pollution in DOMPurify <= 3.4.5 allows persistent bypass of HTML sanitization defaults when application-in
Trusted Types policy state contamination in DOMPurify 3.0.0-3.4.8 allows a previously supplied TRUSTED_TYPES_POLICY to s
Prototype pollution in DOMPurify's USE_PROFILES mode enables DOM-based XSS by causing the sanitizer to accept event hand
URI validation bypass in DOMPurify 3.3.1 and earlier allows `javascript:` protocol payloads to survive HTML sanitization
Cross-site scripting in DOMPurify 3.4.6 and earlier enables script execution when the library's IN_PLACE sanitization mo
Stored XSS is achievable in applications using DOMPurify's setConfig() API combined with an uponSanitizeAttribute hook t
DOMPurify before 3.2.4 has an incorrect template literal regular expression, sometimes leading to mutation cross-site sc
Same weakness CWE-79 – Cross-site Scripting (XSS)
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| SUSE Linux Enterprise Module for SAP Applications 15 SP7 | Affected |
| SUSE Linux Enterprise Server 16.0 | Affected |
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| openSUSE Leap 16.0 | Affected |
| openSUSE Leap 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Affected |
| SUSE Linux Enterprise Module for SAP Applications 15 SP3 | Affected |
| SUSE Linux Enterprise Module for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Module for SAP Applications 15 SP5 | Affected |
| SUSE Linux Enterprise Module for SAP Applications 15 SP6 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP3 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Affected |
EUVD-2026-48269
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB