Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply HTML with armed <img onerror> payload
-
DeliveryApp calls sanitize() IN_PLACE with node-removing hook
-
ExploitHook detaches parent/sibling subtree left un-neutralized
-
ExecutionDetached handler survives after sanitize() returns
-
Impactonerror executes attacker script (DOM XSS)
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 a specific, non-default application configuration: the app must call DOMPurify.sanitize() with IN_PLACE:true AND register a hook (any of beforeSanitizeElements, uponSanitizeElement, afterSanitizeElements, beforeSanitizeAttributes, or afterSanitizeAttributes) that removes a node other than the hook's own node - i.e. the current node's parent/ancestor or a not-yet-visited sibling (the 'drop the whole <figure> if its image is disallowed' pattern). The attacker-supplied markup must contain a deferred handler such as <img onerror> that is already loading so it fires after sanitize() returns. LIMITING FACTORS: default usage, non-IN_PLACE mode, and hooks that only remove their own node are NOT affected (the walker still strips those); impact is confined to the victim browser DOM (no server compromise); and the flaw depends on the application's own hook logic plus the resource load/error event firing, per the advisory's 'input plus an application choice' classification. |
| Impact | Signals point to a genuine but conditional, medium-severity issue rather than a widespread emergency. The vendor CVSS 4.0 score is 5.1 (medium) with AV:N/AC:L/PR:N but UI:A and only low subsequent-system confidentiality/integrity impact (SC:L/SI:L, VA/SA:N), consistent with DOM XSS that executes in the victim's browser without server-side compromise. EPSS is low at 0.16% (6th percentile) and the CVE is NOT in CISA KEV, so there is no indication of active or mass exploitation. A detailed, working proof-of-concept is published in the cure53 GHSA advisory (demonstrated under jsdom and in Chromium/Playwright), so exploit knowledge is fully public even though exploitation is not confirmed in the wild. The decisive risk limiter is the precondition: the flaw only triggers when an application uses IN_PLACE mode together with a hook that removes a node other than its own (a parent, ancestor, or not-yet-visited sibling); default DOMPurify usage is unaffected. Net: this is a real, patch-worthy flaw aligned with the vendor's 'this_month' priority (not act_now/emergency), elevated by DOMPurify's enormous deployment base but sharply narrowed by the non-default hook pattern required. SSVC-style technical impact is partial (browser-context script execution, not host takeover); automatability is effectively limited because it depends on a specific application coding choice, not a default code path. |
| Exploit ScenarioDerived | An application sanitizes attacker-influenced HTML with DOMPurify.sanitize(content, {IN_PLACE: true}) and registers a hook (e.g. afterSanitizeAttributes) that drops a surrounding element - for example 'remove the whole <figure> if its image is disallowed.' The attacker submits markup such as <figure><img class=bad><img src=x onerror=alert(1)></figure>; when the hook removes the parent, the second image's onerror handler is never walked or neutralized and fires in the victim's browser after sanitize() returns, yielding DOM XSS. A full working PoC for this exact scenario is public in the GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 28, 2026
DOM-based XSS in DOMPurify (all versions before 3.4.17) survives sanitization when an application runs IN_PLACE mode with a hook that removes a parent, ancestor, or not-yet-visited sibling: the detached subtree is never walked or neutralized, so an already-loading <img onerror> fires after sanitize() returns. Exploitation is conditional on that specific non-default configuration - remote, unauthenticated, but requiring user interaction and attacker markup containing a deferred handler - and the vendor has released 3.4.17 with a fix (PR 1672 / commit a77a3e7). Risk signals are modest and this is not an emergency: EPSS is 0.16% (6th percentile), there is no CISA KEV entry, and priority is 'this_month'; the vendor advisory itself includes a public proof-of-concept that demonstrates the handler firing in Chromium.
RemediationAI
Upgrade to DOMPurify 3.4.17, which is the fixed version listed for this advisory (vulnerable: <= 3.4.16); the code change is in PR https://github.com/cure53/DOMPurify/pull/1672 and commit https://github.com/cure53/DOMPurify/commit/a77a3e78b59f72fa4d1c83f22e121ad9cc7d3575, and full details are at https://github.com/cure53/DOMPurify/security/advisories/GHSA-mrv2-3pqr-j5jr. If the upgrade must be staged, the practical compensating controls follow the advisory's own analysis: stop using IN_PLACE:true and switch to the default string-returning mode (this changes the API contract - the sanitized output must be assigned back into the DOM rather than mutating the live tree in place), and audit every registered hook so it only removes the node it was invoked with, never an ancestor or an unvisited sibling, since only self-removal remains safely handled by the walker. Applications that genuinely need ancestor/sibling removal under IN_PLACE should post-process the returned tree themselves - recording the next node and the current node's ancestors before each hook call and neutralizing anything no longer attached under root, or collecting the original elements up front and neutralizing those no longer connected after the walk - which carries the trade-off of added application-side traversal cost and its own potential for gaps. Because exploitation needs attacker markup with a deferred handler such as <img onerror> that is already loading, tightening Content-Security-Policy to block inline handlers and restricting image sources reduces the chance a surviving handler executes, but does not repair the sanitizer's guarantee. No vendor-released patch is needed beyond 3.4.17; EPSS is low and there is no KEV entry, so scheduling this within the current monthly patch cycle matches the 'this_month' priority.
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 widely used client-side HTML/SVG sanitizer built on the DOM; in IN_PLACE mode it mutates the caller's live tree rather than returning a sanitized string, walking nodes with a TreeWalker and applying five user hook points (beforeSanitizeElements, uponSanitizeElement, afterSanitizeElements, beforeSanitizeAttributes, afterSanitizeAttributes). The root cause is CWE-79 (improper neutralization of input during web page generation), with the advisory also tagging CWE-693 (protection mechanism failure): the guard introduced for GHSA-p98j-92pf-mc4p in 3.4.16 lives in _handleHookDetachedNode() (src/purify.ts line 2134, dist/purify.cjs.js line 2009 in 3.4.16) and only checks whether the hook's own currentNode lost its parent (currentNode = root || getParentNode(currentNode) ! null). If the hook instead removes currentNode.parentNode, any ancestor, or a later sibling that the walker has not yet reached, currentNode still reports a parent, so _neutralizeSubtree() is never invoked; the removed subtree is also outside the walker's reach and absent from DOMPurify.removed, so the post-walk pass does not see it either - event handler attributes stay armed on elements whose resource load is already in flight. This is the same failure pattern as GHSA-55q2-fjhq-7xh7 and GHSA-p98j-92pf-mc4p and is an incomplete fix of the latter. Default (non-IN_PLACE) usage and hooks that remove only the node they were called for are not affected, because the walker still visits and strips those nodes; the flaw requires untrusted input plus an application choice of hook logic, and impact is confined to the victim's browser DOM with no server-side component. The exact sanitizer internals are documented in the advisory; the trigger requires the attacker markup to contain an element such as <img onerror> that is already loading at the time of the walk.
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 attacker markup needs no auth (PR:N); the handler executes in the victim browser context (S:C, C:L/I:L, A:N) and depends on the resource load/error firing (UI:R), with the IN_PLACE+removing-hook precondition noted separately rather than scored as attacker complexity.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
DOMPurify before 3.4.17 contains a cross-site scripting vulnerability that allows attackers to keep event handlers armed when an IN_PLACE hook removes a parent or sibling node. Attacker markup in detached subtrees is never walked or neutralized, so handlers like img onerror fire after sanitize() returns, causing DOM XSS.
Blast Radius
ecosystem impact- 16,332 npm packages depend on dompurify (3,926 direct, 12,648 indirect)
Ecosystem-wide dependent count for version 3.4.17.
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-110511
GHSA-77h4-4vqj-j7vc
NVD
CVE.org
EPSS
Exploit-DB