Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted markup to app
-
DeliveryMarkup stored and sanitized with SAFE_FOR_TEMPLATES
-
ExploitClean string assigned to innerHTML
-
ExecutionBraces merge into live {{...}} on reparse
-
PersistTemplate engine compiles and evaluates expression
-
ImpactAttacker JavaScript runs in victim origin
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 | Three conditions must all hold in the consuming application: (1) DOMPurify is invoked with SAFE_FOR_TEMPLATES: true (a non-default, protective option used for its documented purpose); (2) the sanitized string is written into the DOM through an HTML sink such as innerHTML; and (3) a template engine that compiles existing DOM - confirmed with Vue 3 in-DOM templates and AngularJS 1.8.3, and likely other mustache-style engines - then evaluates that DOM. The attacker only needs to supply markup passed to sanitize(). Limiting factors: exploitation does not work against DOMPurify's default configuration (SAFE_FOR_TEMPLATES is off by default), requires the specific sink-plus-template-engine pipeline, and requires a victim to view the page (UI:A); applications that do not use SAFE_FOR_TEMPLATES or do not compile sanitized DOM with a client-side template engine are not affected. |
| Impact | This is a genuine but conditional risk, best characterized as medium severity (CVSS 4.0 base 5.1) rather than a top-tier emergency. The 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:A) shows a network-reachable, low-complexity, unauthenticated flaw, but impact is confined to subsequent-system confidentiality and integrity (SC:L/SI:L) with no availability impact and no direct impact to the DOMPurify component itself (VC:N/VI:N/VA:N) - consistent with a stored/client-side XSS whose damage lands in the victim's browser session, not the sanitizer. The decision signals are moderate and internally consistent: SSVC records Exploitation=poc (not active), Automatable=no, and Technical Impact=partial, and the vuln.today priority is 'this_month' - i.e. patch on a normal cycle, not act_now. No CISA KEV listing and no EPSS score were supplied, so widespread or automated exploitation is not evidenced. The most important caveat is applicability, not signal conflict: exploitation is gated on a specific application configuration (SAFE_FOR_TEMPLATES: true feeding an innerHTML sink that a DOM-compiling template engine then evaluates), so a 'network/unauthenticated' CVSS reading overstates reach for the majority of DOMPurify deployments that do not use that combination. Where that combination exists, the PoC is deterministic across Chromium 156, Firefox 157 and WebKit 27.2, making it a real, prioritizable issue for affected apps. |
| Exploit ScenarioDerived | An attacker submits crafted HTML (a comment, profile field, or rich-text message) to an application that sanitizes it with DOMPurify's SAFE_FOR_TEMPLATES: true, then inserts the 'clean' string into the page via innerHTML where Vue 3 or AngularJS compiles the resulting DOM. The sanitized output contains no literal {{ or }}, but on reparse the split braces merge into a live {{...}} expression that the template engine evaluates, running attacker JavaScript in the origin for every user who views the content. A full working proof-of-concept (nested-form and orphaned-end-tag variants, verified against Vue 3.5.45 and AngularJS 1.8.3) is published in the GHSA advisory, so publicly available exploit code exists. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Dec 02, 2026
Template-expression smuggling in DOMPurify before 3.4.18 allows attacker-supplied markup to reassemble into a live {{...}} expression after sanitization, defeating the SAFE_FOR_TEMPLATES protection and yielding JavaScript execution in the victim's browser. Exploitation is conditional and unauthenticated at the sanitizer layer: the consuming application must enable SAFE_FOR_TEMPLATES: true (off by default), write the returned string into an HTML sink such as innerHTML, and then have a DOM-compiling template engine such as Vue 3 in-DOM templates or AngularJS 1.8.3 evaluate that DOM; a victim must then view the page (UI:A). SSVC records exploitation status as PoC and the upstream advisory publishes a working proof-of-concept verified on Chromium, Firefox and WebKit, but there is no CISA KEV entry, and the independent assessment rates this a conditional medium-severity risk (CVSS 4.0 base 5.1) rather than a top-tier emergency.
RemediationAI
Vendor-released patch: upgrade dompurify to 3.4.18 or later (npm: dompurify@3.4.18), which is the complete fix per the upstream advisory GHSA-qm7q-q8h9-jg8q. Where an upgrade cannot be shipped immediately, the practical compensating control is to break the third exploitation condition rather than to tune the sanitizer: do not hand SAFE_FOR_TEMPLATES-sanitized strings to a template engine for DOM compilation - render them as inert text, or build the output with createElement/textContent or a non-compiling binding so Vue/AngularJS never evaluates braces in the inserted markup - at the cost of losing in-DOM template interpolation inside untrusted content. Applications that do not actually need SAFE_FOR_TEMPLATES can leave it disabled (its default), which removes the bypass surface entirely but also removes the mustache hardening it was providing, so those must not later feed sanitized markup into a mustache engine. A defensive check in the consuming code is to reparse the sanitized string and reject or reserialize output where adjacent text fragments contain split braces, accepting the added parsing cost per sanitization. Note that the two scrub passes in the affected releases cannot be trusted as a boundary: output that contains no literal {{ or }} can still become an expression after the browser reparses it.
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 is a client-side (and jsdom-compatible server-side) HTML sanitizer built on the browser's own parser: it walks the parsed DOM, strips disallowed nodes and attributes, then serializes the tree back to a string. The SAFE_FOR_TEMPLATES option is a protective mustache-hardening feature that runs the regex set in src/regexp.ts (notably MUSTACHE_EXPR = /{{[\w\W]*|^[\w\W]*}}/g) in two places - once per text node during the walk and once over the final serialized string - on the assumption that "no braces in any text node" plus "no braces in the serialized output" equals "no expression after the consumer parses the string again". That assumption is wrong because serialization is not parse-inverse. In variant one, a nested <form> payload produces three separate text nodes ('{', '{...}', '}') that contain no '{{' or '}}' and survive both scrubs; on reparse the HTML parser ignores the inner <form> start tag because the form element pointer is already set, so the fragments merge into one text node holding a live expression. In variant two, the ^[\w\W]*}} branch of MUSTACHE_EXPR is applied to markup rather than text, slicing start tags off the serialized string while leaving orphaned </i> and </b> end tags; those are dropped on reparse and the braces merge again. The same regex-over-markup behaviour can also strip a closing </form> tag. The root cause class is CWE-79 (cross-site scripting) compounded by CWE-1336 (template injection): the sanitizer's guarantee is expressed against a parse tree that differs from the tree the consumer builds, so client-side template engines that compile already-parsed DOM (confirmed with Vue 3 in-DOM templates and AngularJS 1.8.3) evaluate attacker-authored expressions.
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
Unauthenticated attacker-supplied markup (PR:N) that executes only when a victim views the page (UI:R); XSS escapes the sanitizer into the app context (S:C) with limited confidentiality and integrity impact and no availability impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
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.
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
SAFE_FOR_TEMPLATES bypass in DOMPurify 3.0.0-3.4.7 allows template expressions such as ${evil}, {{evil}}, and <%evil%> t
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
EUVD-2026-140252
GHSA-94h2-9755-qfgp
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB