Skip to main content

DOMPurify CVE-2026-75838

| EUVDEUVD-2026-60602 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-08-18 VulnCheck GHSA-748c-f84h-hp2v
5.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Craft HTML with img onload handler nested inside hook-targeted element
  2. Delivery
    Submit payload to IN_PLACE-configured DOMPurify application
  3. Exploit
    uponSanitizeElement hook calls node.remove(), triggering early return in _sanitizeElements()
  4. Install
    Detached subtree bypasses _neutralizeSubtree() and DOMPurify.removed list
  5. C2
    sanitize() returns with root appearing clean
  6. Execute
    Browser event loop fires pre-queued onload handler
  7. Impact
    Attacker 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

DOMPurify 0 <3.4.13

Affected Packages

npm dompurify fix: 3.4.13

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

Vendor (VulnCheck) PRIMARY 5.1 MEDIUM
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
vuln.today AI 4.7 MEDIUM

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.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
SUSE 4.6 MEDIUM
AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L
Red Hat 7.3 HIGH

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Aug 18, 2026 - 12:02 EUVD
CVE Published
Aug 18, 2026 - 11:19 cve.org
MEDIUM 5.1

DescriptionCVE.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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 231 npm packages depend on dompurify (113 direct, 118 indirect)

Ecosystem-wide dependent count for version 3.4.13.

Threat Intelligence Overview

EPSS Score
0.3%
Top 77% exploitable
Prevalence
High
widely-used npm HTML sanitization library across web applications
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub VulDB

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

CVE-2024-47875 MEDIUM POC
6.1 Oct 11

DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. Rated medium severity (CVSS 6

CVE-2020-26870 MEDIUM POC
6.1 Oct 07

Cure53 DOMPurify before 2.0.17 allows mutation XSS. Rated medium severity (CVSS 6.1), this vulnerability is remotely exp

CVE-2019-16728 MEDIUM POC
6.1 Sep 24

DOMPurify before 2.0.1 allows XSS because of innerHTML mutation XSS (mXSS) for an SVG element or a MATH element, as demo

CVE-2024-48910 CRITICAL
9.8 Oct 31

DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. Rated critical severity (CVSS

CVE-2026-65914 MEDIUM POC
5.3 Jul 23

Mutation-XSS in DOMPurify before 3.3.2 enables JavaScript execution in victim browsers when sanitized output is re-inser

CVE-2026-65902 MEDIUM POC
5.3 Jul 23

Hook mutation pollution in DOMPurify <= 3.4.5 allows persistent bypass of HTML sanitization defaults when application-in

CVE-2026-65899 MEDIUM POC
5.1 Jul 23

Trusted Types policy state contamination in DOMPurify 3.0.0-3.4.8 allows a previously supplied TRUSTED_TYPES_POLICY to s

CVE-2026-65913 MEDIUM POC
5.1 Jul 23

Prototype pollution in DOMPurify's USE_PROFILES mode enables DOM-based XSS by causing the sanitizer to accept event hand

CVE-2026-65912 MEDIUM POC
5.1 Jul 23

URI validation bypass in DOMPurify 3.3.1 and earlier allows `javascript:` protocol payloads to survive HTML sanitization

CVE-2026-65900 MEDIUM POC
5.1 Jul 23

SAFE_FOR_TEMPLATES bypass in DOMPurify 3.0.0-3.4.7 allows template expressions such as ${evil}, {{evil}}, and <%evil%> t

CVE-2026-65901 MEDIUM POC
5.1 Jul 23

Cross-site scripting in DOMPurify 3.4.6 and earlier enables script execution when the library's IN_PLACE sanitization mo

CVE-2026-65898 MEDIUM POC
5.1 Jul 23

Stored XSS is achievable in applications using DOMPurify's setConfig() API combined with an uponSanitizeAttribute hook t

Vendor 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

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy