Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAttacker influences earlier DOMPurify policy config
-
DeliveryUnsafe TRUSTED_TYPES_POLICY stored in shared instance
-
ExploitVictim code calls clearConfig() (state not fully reset)
-
InstallVictim calls sanitize() with RETURN_TRUSTED_TYPE flag
-
C2Retained unsafe policy signs TrustedHTML output
-
ExecutePoisoned TrustedHTML assigned to DOM sink
-
ImpactScript 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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: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
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
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.
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
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- 291 npm packages depend on dompurify (15 direct, 277 indirect)
Ecosystem-wide dependent count for version 3.4.9.
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
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
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
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
DOMPurify before 3.2.4 has an incorrect template literal regular expression, sometimes leading to mutation cross-site sc
Same weakness CWE-693 – Protection Mechanism Failure
View allSame technique Information Disclosure
View allVendor 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 |
| 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 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 SP4 | Affected |
| SUSE Linux Enterprise Module for SAP Applications 15 SP5 | Affected |
| SUSE Linux Enterprise Module for SAP Applications 15 SP6 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP3 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Affected |
EUVD-2026-48268
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB