Skip to main content

DOMPurify CVE-2026-65899

| EUVDEUVD-2026-48268 MEDIUM
Protection Mechanism Failure (CWE-693)
2026-07-23 VulnCheck
5.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Recon
    Attacker influences earlier DOMPurify policy config
  2. Delivery
    Unsafe TRUSTED_TYPES_POLICY stored in shared instance
  3. Exploit
    Victim code calls clearConfig() (state not fully reset)
  4. Install
    Victim calls sanitize() with RETURN_TRUSTED_TYPE flag
  5. C2
    Retained unsafe policy signs TrustedHTML output
  6. Execute
    Poisoned TrustedHTML assigned to DOM sink
  7. Impact
    Script executes in user browser

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V15 - Secure Coding and Architecture Protection mechanism completeness
Exploitation Conditions

Exploitation requires all three of the following conditions to hold simultaneously: (1) A single DOMPurify instance (not separate instances) is reused across two or more distinct trust contexts within the same application - the classic pattern is a shared singleton in a frontend framework. (2) At least one earlier caller supplies a TRUSTED_TYPES_POLICY configuration option to that shared instance, and that policy is either permissive or attacker-influenced. (3) A later caller invokes clearConfig() (expecting state reset) followed by sanitize() with RETURN_TRUSTED_TYPE: true, requesting a TrustedHTML object for use at a Trusted Types sink. If RETURN_TRUSTED_TYPE is not used, the retained policy does not affect string output. If the application always creates a fresh DOMPurify instance per call context, this vulnerability is not reachable. Limiting factors: requires Trusted Types to be configured in the application, requires the RETURN_TRUSTED_TYPE API flag, and requires a shared-instance architecture - none of which are default for typical DOMPurify usage.

Impact

The CVSS 4.0 score of 5.1 (Medium) with vector AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L reflects that impact is confined to the subsequent system (the browser application context) rather than the vulnerable library itself, and that active user interaction is required. The AC:L and AT:N assignments suggest the vendor views the base conditions as straightforward, though real-world exploitation is gated on a specific architecture: the application must share a DOMPurify instance across trust boundaries and use the RETURN_TRUSTED_TYPE API. This is a non-default usage pattern not found in every DOMPurify deployment, which functionally raises real-world attack complexity beyond what AC:L implies. No EPSS score is available in the provided data; given the conditional exploitation requirements and the absence of a KEV listing, mass exploitation appears unlikely. However, a public PoC is confirmed in the GHSA advisory, meaning an attacker with visibility into a vulnerable application's DOMPurify usage pattern can exploit this deterministically. The risk is highest in large frontend monorepos or micro-frontend architectures where multiple teams share a DOMPurify singleton and some teams may supply custom Trusted Types policies.

Exploit ScenarioDerived

A micro-frontend application shares one DOMPurify instance; a less-trusted plugin integration sets a TRUSTED_TYPES_POLICY that permits arbitrary HTML (e.g., to render legacy rich-text content). The core application later calls clearConfig() and then sanitize(userInput, { RETURN_TRUSTED_TYPE: true }) expecting clean output for a Trusted Types-protected sink. Instead, the retained unsafe policy signs the output, and attacker-supplied markup such as <img src=x onerror=alert(1)> reaches the DOM and executes. A working PoC demonstrating this exact scenario is attached to GHSA-vxr8-fq34-vvx9 and confirmed to produce script execution alerts in the test environment.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.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

Trusted Types policy state contamination in DOMPurify 3.0.0-3.4.8 allows a previously supplied TRUSTED_TYPES_POLICY to survive a clearConfig() call, poisoning subsequent sanitize() calls that request RETURN_TRUSTED_TYPE output. Any application that reuses a single DOMPurify instance across trust boundaries - where one integration sets a permissive or attacker-influenced TRUSTED_TYPES_POLICY and a later caller invokes clearConfig() expecting a clean slate - will receive a TrustedHTML object signed by the old policy, potentially enabling script execution at a Trusted Types sink. A public proof-of-concept is attached to the GHSA advisory; exploitation is not confirmed in CISA KEV.

RemediationAI

Upgrade DOMPurify to version 3.4.9 or later (vendor-released patch: 3.4.9), which corrects the clearConfig() implementation to properly reset trustedTypesPolicy. The patch commit is available at https://github.com/cure53/DOMPurify/commit/825e617753ac1169306a542d3174a77f717a0cf6. For teams unable to upgrade immediately, the primary compensating control is to avoid sharing a single DOMPurify instance across trust boundaries - instead, instantiate a fresh DOMPurify instance per trust context, which eliminates the state contamination vector entirely. A secondary workaround is to explicitly pass TRUSTED_TYPES_POLICY: <safe-policy> on every sanitize() call where RETURN_TRUSTED_TYPE is used, rather than relying on clearConfig() to reset state; note that this approach is fragile and depends on caller discipline. Do not rely on TRUSTED_TYPES_POLICY: null to clear a previously set policy, as this is explicitly documented as ineffective in affected versions. The full advisory is at https://github.com/cure53/DOMPurify/security/advisories/GHSA-vxr8-fq34-vvx9.

Affected VersionsENISA

DOMPurify 0 <3.4.9

Affected Packages

npm dompurify fix: 3.4.9

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:2.3:a:cure53:dompurify:*) is a widely used DOM-based XSS sanitizer for JavaScript. This flaw (CWE-693: Protection Mechanism Failure) resides in the internal state machine governing Trusted Types integration. Specifically, _parseConfig() at src/purify.ts:786-812 assigns trustedTypesPolicy when cfg.TRUSTED_TYPES_POLICY is truthy, but the null/default path at lines 813-832 only initializes the internal policy when trustedTypesPolicy === undefined - it does not reset an already-set value. clearConfig() at lines 2133-2136 clears only CONFIG and SET_CONFIG, leaving trustedTypesPolicy and emptyHTML intact. The serialization path at lines 2123-2125 then signs the output with the retained policy when RETURN_TRUSTED_TYPE is true. Passing TRUSTED_TYPES_POLICY: null in a subsequent call also fails to clear the stale reference, compounding the issue. Trusted Types is a browser security mechanism designed to prevent DOM-based XSS by requiring HTML to be wrapped in a TrustedHTML object before being assigned to dangerous sinks; this flaw undermines that guarantee by substituting an unsafe policy object for the expected clean one.

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:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
vuln.today AI 4.7 MEDIUM

AC:H reflects three specific co-requisites (shared instance, TRUSTED_TYPES_POLICY set by earlier caller, RETURN_TRUSTED_TYPE used by later caller); S:C because the Trusted Types security boundary is crossed; no availability impact.

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:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
SUSE 6.1 HIGH
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Red Hat 6.1 MEDIUM

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

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

DescriptionCVE.org

DOMPurify 3.0.0 before 3.4.9 does not reset the retained Trusted Types policy when clearConfig() is called, so a DOMPurify instance reused across trust boundaries stays bound to a previously supplied TRUSTED_TYPES_POLICY. A later caller that requests RETURN_TRUSTED_TYPE output receives a TrustedHTML object created by the old (potentially unsafe) policy rather than a clean default, which can lead to script execution at a Trusted Types sink. Passing TRUSTED_TYPES_POLICY: null on the later call also does not clear the retained policy.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 291 npm packages depend on dompurify (15 direct, 277 indirect)

Ecosystem-wide dependent count for version 3.4.9.

Threat Intelligence Overview

EPSS Score
0.2%
Top 88% exploitable
Prevalence
High
among the most downloaded HTML sanitizers on npm, used globally
Exploit
POC
Public exploit code exists
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 Yes
EPSS 0.2%
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
None
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
High
Technical Impact
Partial

Priority Score

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

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

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

CVE-2025-26791 MEDIUM POC
4.5 Feb 14

DOMPurify before 3.2.4 has an incorrect template literal regular expression, sometimes leading to mutation cross-site sc

Vendor StatusVendor

SUSE

Severity: Important
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