Skip to main content

DOMPurify CVE-2026-65904

| EUVDEUVD-2026-48273 LOW
Improper Check for Unusual or Exceptional Conditions (CWE-754)
2026-07-23 VulnCheck
2.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Control or inject content into same-origin cross-realm iframe
  2. Delivery
    Application retrieves malicious element via iframe.contentDocument
  3. Exploit
    Application invokes DOMPurify with IN_PLACE mode on foreign-realm element
  4. Execution
    _isNode() instanceof check fails cross-realm
  5. Persist
    DOMPurify returns original unsanitized element
  6. Impact
    XSS payload executes in victim's browser session

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A10:2025 - Mishandling of Exceptional Conditions
ASVS 5.0
V16 - Security Logging and Error Handling Unusual condition handling
Exploitation Conditions

Exploitation requires two simultaneous application-level conditions to be met: first, the application must explicitly invoke DOMPurify with the IN_PLACE mode option enabled - this is not the default behavior and must be deliberately configured by the developer; second, the DOM element passed to DOMPurify must originate from a different JavaScript realm, specifically from a cross-realm document such as an iframe's contentDocument, a popup window opened via window.open(), or any other browsing context with a distinct window/global object. Standard DOMPurify usage - passing HTML strings, or passing same-realm DOM nodes - is entirely unaffected by this vulnerability. Exploitation is further constrained by the attacker's need to control or inject content into the cross-realm document (requiring either a same-origin relationship with the iframe source or another injection vector), and by the requirement for user interaction (UI:P) to load and trigger the affected page. The vendor's explicit scoping of this as outside the threat model confirms these conditions are edge-case rather than mainstream usage patterns.

Impact

The CVSS 4.0 score of 2.3 is intentionally low and accurately reflects genuine exploitation constraints: AC:H captures the prerequisite that the calling application must be architected to retrieve DOM elements from a cross-realm context, AT:P encodes the specific attack condition (IN_PLACE mode explicitly enabled plus cross-realm element source), and UI:P requires victim interaction with the vulnerable page. The score's subsequent-system impact (SC:L/SI:L) reflects that successful exploitation results in limited XSS in the victim's browser session rather than server-side compromise. No EPSS data was provided; given AC:H and AT:P, real-world exploitation probability is assessed as low, as it depends on a narrow application architecture pattern. No KEV listing has been confirmed, and no public POC exploit has been identified at time of analysis. The material risk amplifier is the vendor's explicit refusal to patch - all DOMPurify deployments through 3.3.3 remain permanently exposed to this specific bypass without an upstream fix, which shifts remediation burden entirely to application developers. Security teams should prioritize this issue proportionally: low immediate exploitation risk, but architecturally significant for applications that explicitly use IN_PLACE mode with cross-frame content.

Exploit ScenarioDerived

An attacker who can influence content within a same-origin iframe targeted by a web application retrieves a malicious DOM element from that iframe's contentDocument and ensures the application passes it to DOMPurify with IN_PLACE mode enabled. Because DOMPurify's instanceof check fails across realm boundaries, the XSS payload embedded in the element survives sanitization and is inserted into the parent document, executing arbitrary script in the victim's browser session. No public POC has been identified at time of analysis, but the bypass mechanism is described with sufficient technical specificity in the vendor advisory to be independently reproducible.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.2% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jul 23, 2026

DOMPurify's IN_PLACE sanitization mode silently bypasses XSS filtering when processing DOM elements sourced from a different JavaScript window context (e.g., an iframe's contentDocument), returning the unsanitized element - payloads intact - to the calling application. The private _isNode() function's instanceof check fails for foreign-realm nodes because prototype chains belong to distinct window objects, causing DOMPurify to misidentify the input, disable IN_PLACE mode silently, and pass through unfiltered content. The vendor has explicitly declined to issue a fix, categorizing this as outside DOMPurify's threat model, leaving all versions through 3.3.3 permanently exposed without a vendor-supplied remediation path.

RemediationAI

No vendor-released patch exists and none is planned - the vendor considers this an edge case outside DOMPurify's defined threat model, confirmed by the advisory at https://github.com/cure53/DOMPurify/security/advisories/GHSA-4w3q-35jp-p934. The primary mitigation is to discontinue use of DOMPurify's IN_PLACE mode with DOM elements sourced from cross-realm contexts (iframes, popup windows, or any distinct browsing context). Applications should serialize foreign-realm content to an HTML string before passing it to DOMPurify (e.g., use element.outerHTML as input rather than the element itself); this trades a minor performance benefit for guaranteed sanitization. If IN_PLACE processing of cross-realm elements is architecturally unavoidable, implement a pre-check that validates instanceof against the element's own ownerDocument.defaultView before invoking DOMPurify, and reject or re-serialize elements that fail this check. Deploying a strict Content Security Policy (CSP) with script-src restrictions will not prevent the bypass but limits downstream XSS impact by constraining what injected scripts can do. Migrating cross-realm sanitization workflows to a Trusted Types policy or a DOMParser-based approach in the current window context are viable architectural alternatives for high-security deployments. No exact fix version can be cited because no patch is available.

Affected VersionsENISA

DOMPurify 0 <3.4.4

Affected Packages

euvd dompurify fix: 3.4.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

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:*:*:*:*:*:*:*:*) is a widely embedded JavaScript XSS sanitization library by Cure53, typically used to strip dangerous HTML and script content before rendering untrusted markup. Its IN_PLACE mode allows sanitization of live DOM nodes directly rather than processing HTML strings, which is more efficient but introduces realm-sensitivity. The root cause maps to CWE-754 (Improper Check for Unusual or Exceptional Conditions): the private _isNode() function performs a standard JavaScript instanceof check, which silently returns false when the node's prototype chain originates from a different realm (window/global object). This is a known JavaScript platform limitation - cross-realm type checking with instanceof is unreliable without explicit cross-realm guard logic. DOMPurify does not account for this case in its IN_PLACE code path, so rather than raising an error or refusing to process the node, it stringifies the element (producing '[object HTMLDivElement]'), silently resets the IN_PLACE flag to false, and returns the original DOM node unmodified. Any XSS payload embedded in that node survives the sanitization call entirely intact.

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 2.3 LOW
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
vuln.today AI 4.7 MEDIUM

AC:H reflects the cross-realm DOM architecture requirement; UI:R for victim page interaction; S:C and C:L/I:L capture limited XSS impact on the victim's browser session.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
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
Jul 23, 2026 - 15:18 EUVD
CVE Published
Jul 23, 2026 - 13:16 cve.org
LOW 2.3

DescriptionCVE.org

DOMPurify through 3.3.3 fails to sanitize DOM elements passed via IN_PLACE mode when the element originates from a different window/realm (e.g., an iframe's contentDocument). A cross-realm instanceof check in the private _isNode() function returns false for foreign-realm nodes, causing DOMPurify to stringify the element (yielding '[object HTMLDivElement]'), silently reset IN_PLACE to false, and return the unsanitized element unchanged with any XSS payloads intact. The vendor considers this an edge case outside DOMPurify's threat model and, at time of publication, no fix was planned.

Threat Intelligence Overview

EPSS Score
0.2%
Top 95% exploitable
Prevalence
High
widely adopted XSS sanitization library across modern web applications
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment 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 LOW
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.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

12
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +12
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

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