Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconCraft HTML with img onload handler nested inside hook-targeted element
-
DeliverySubmit payload to IN_PLACE-configured DOMPurify application
-
ExploituponSanitizeElement hook calls node.remove(), triggering early return in _sanitizeElements()
-
InstallDetached subtree bypasses _neutralizeSubtree() and DOMPurify.removed list
-
C2sanitize() returns with root appearing clean
-
ExecuteBrowser event loop fires pre-queued onload handler
-
ImpactAttacker JavaScript executes in victim browser context
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 concurrent conditions must be met: (1) the application must explicitly pass IN_PLACE: true in the DOMPurify configuration - this is a non-default mode that must be deliberately opted into by the developer; (2) the application must register a hook via DOMPurify.addHook() on 'uponSanitizeElement' or 'beforeSanitizeElements' that calls node.remove() on a matched element during sanitization; and (3) the attacker must be able to supply HTML content that the application passes to DOMPurify.sanitize(). The attacker does not need any privileges against the DOMPurify library itself; their access to the HTML injection point is determined solely by the host application's own authentication and authorization controls. Exploitation is further constrained to browsers that queue resource events (such as img onload with a data-URI src) during DOM construction before sanitization completes - behavior confirmed in Chromium. Applications using DOMPurify without IN_PLACE mode, or with IN_PLACE mode but no element-removal hooks, are not affected by this specific code path. |
| Impact | The vendor-assigned CVSS 4.0 score of 5.1 (AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N) accurately reflects moderate real-world severity; the subsequent-system impact metrics SC:L and SI:L capture the typical XSS consequence of arbitrary JavaScript execution in the victim's browser session. No EPSS data was provided in the input, so exploitation probability is inferred from the public PoC: a working exploit targeting DOMPurify 3.4.12 is embedded in the GHSA advisory itself, which substantially increases near-term exploitation likelihood compared to the moderate CVSS score alone - even a mid-sized municipal IT team in walbrzych running a web application with custom DOMPurify hooks should treat this as urgent given how low the attacker's bar is once the preconditions exist. The critical limiting factor is the double precondition: the application must both enable IN_PLACE mode explicitly and register an element-removal hook, narrowing the exploitable population considerably compared to a default-configuration flaw. This vulnerability is not listed in the CISA KEV catalog at time of analysis, so active exploitation is not confirmed; the PR:L metric in the provided vector suggests the vendor models the attacker as needing some application-level access to supply HTML, though the actual privilege requirement depends entirely on the host application's access controls. No conflicting signals exist across the GHSA advisory, ENISA EUVD entry, and VulnCheck data; all are internally consistent. |
| Exploit ScenarioDerived | An attacker targeting a web application that accepts user-supplied HTML - such as a rich-text comment field or content import feature - crafts a payload containing an img element with a data-URI src and an onload event handler, nested inside a footer element that a registered uponSanitizeElement hook removes via node.remove(). The application calls DOMPurify.sanitize(root) with IN_PLACE: true; the hook fires for the footer element, detaches it (and the img descendant), and the function returns early - bypassing _neutralizeSubtree(). When the event loop advances after sanitize() returns, the browser fires the pre-queued onload event on the still-disconnected img, executing the attacker's JavaScript in the victim's page context. A working proof-of-concept demonstrating this exact flow against DOMPurify 3.4.12 in Chromium is publicly available in the GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 18, 2026
IN_PLACE sanitization bypass in DOMPurify before 3.4.13 enables persistent cross-site scripting after sanitize() returns, affecting any application that uses DOMPurify's documented element-removal hook pattern with IN_PLACE mode enabled. When a uponSanitizeElement or beforeSanitizeElements hook removes a node via node.remove(), DOMPurify's _sanitizeElements() exits that node's processing branch without invoking _neutralizeSubtree(), leaving descendant elements - including those carrying browser-queued event handlers such as img onload - outside both the returned DOM and the DOMPurify.removed list. A working proof-of-concept targeting DOMPurify 3.4.12 under Chromium is published in the official GHSA advisory; no active exploitation is confirmed in CISA KEV at time of analysis.
RemediationAI
Upgrade DOMPurify to version 3.4.13 or later (npm install dompurify@3.4.13), which contains the fix confirmed in upstream commit https://github.com/cure53/DOMPurify/commit/3067f7746769 and pull request https://github.com/cure53/DOMPurify/pull/1557, as documented in the vendor advisory at https://github.com/cure53/DOMPurify/security/advisories/GHSA-55q2-fjhq-7xh7. If an immediate upgrade is not feasible, the most targeted compensating control is to refactor all element-removal hooks to avoid calling node.remove() directly; instead, return DOMPURIFY_REMOVE from the hook so that DOMPurify's own removal path handles detachment and correctly calls _neutralizeSubtree() - this eliminates the vulnerable early-return branch without requiring architectural changes. Alternatively, disable IN_PLACE mode and use the default fragment-based sanitization, which is unaffected by this code path; note that this changes the return type from the original node to a DocumentFragment and will require corresponding application code updates. Removing all element-removal hooks from uponSanitizeElement and beforeSanitizeElements callbacks eliminates the attack surface entirely at the cost of relying solely on DOMPurify's tag/attribute allowlist for element filtering.
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 (CPE: cpe:2.3:a:cure53:dompurify:*:*:*:*:*:*:*:*, npm package 'dompurify') is a widely-deployed JavaScript HTML sanitization library authored by cure53. The root cause is CWE-79 (Improper Neutralization of Input During Web Page Generation) manifesting in the IN_PLACE sanitization code path. Specifically, _sanitizeElements() in src/purify.ts (lines 1862-1904) executes beforeSanitizeElements or uponSanitizeElement hooks on each DOM node and returns early when the hook signals removal by detaching the current node. This early return path omits the call to _neutralizeSubtree(currentNode) that would otherwise strip event handlers from all descendants. Because the detached subtree is also never appended to the DOMPurify.removed array, the post-walk IN_PLACE cleanup pass cannot locate or neutralize it. The browser's event queue may already contain a resource event (e.g., onload for a data-URI img) that was registered during construction of the dirty input root; once the event loop advances after sanitize() returns, that handler fires on the disconnected element. DOMPurify's ordinary (non-hook) removal path correctly calls the subtree neutralization routine, so only hook-initiated detachments are affected.
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:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
AC:H reflects the double precondition of IN_PLACE mode plus an element-removal hook; PR:N since the attacker only supplies HTML; S:C for script execution in the victim's browser origin.
AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
DOMPurify before 3.4.13 contains a cross-site scripting vulnerability in IN_PLACE sanitization where element-removal hooks fail to neutralize detached subtrees. Attackers can supply HTML with event handlers on descendant elements that execute after sanitization completes, even though the returned root appears clean.
Blast Radius
ecosystem impact- 231 npm packages depend on dompurify (113 direct, 118 indirect)
Ecosystem-wide dependent count for version 3.4.13.
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
Same weakness CWE-79 – Cross-site Scripting (XSS)
View allVendor StatusVendor
SUSE
Severity: Moderate| 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 Module for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Module for SAP Applications 15 SP5 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | 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 SP6 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP3 | Affected |
EUVD-2026-60602
GHSA-748c-f84h-hp2v
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB