Skip to main content

DOMPurify EUVDEUVD-2026-48271

| CVE-2026-65902 MEDIUM
Trust Boundary Violation (CWE-501)
2026-07-23 VulnCheck
5.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Recon
    Attacker submits content triggering hook execution
  2. Delivery
    Hook writes to data.allowedTags or data.allowedAttributes
  3. Exploit
    DEFAULT_ALLOWED_TAGS / DEFAULT_ALLOWED_ATTR permanently widened
  4. Install
    Attacker submits crafted payload using poisoned tag/attribute
  5. C2
    Subsequent sanitize() with default config passes payload
  6. Execute
    Poisoned HTML rendered in victim browser
  7. Impact
    XSS executes in victim session

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V14 - Data Protection Trust boundary enforcement
Exploitation Conditions

Exploitation requires two simultaneous conditions in the target application: (1) a uponSanitizeElement or uponSanitizeAttribute hook must be installed that writes to data.allowedTags[tagName] = true or data.allowedAttributes[attrName] = true - this is described in the advisory as a natural-looking pattern for 'allow X for this iteration' and is not unusual in applications that conditionally permit additional elements; and (2) the application must subsequently call sanitize() on attacker-influenced input using the default configuration, meaning without explicit cfg.ALLOWED_TAGS or cfg.ALLOWED_ATTR arrays overriding the defaults. Applications that never install hooks of this type are not exploitable. Applications that always pass explicit allow-lists to every sanitize() call are not exploitable even if they install mutating hooks. The CVSS 4.0 UI:P metric reflects that the hook mutation (the poisoning event) must occur before the attacker's payload is processed, introducing a timing dependency. The scope of the impact is bounded to the same DOMPurify instance; separate instances or fresh constructions are unaffected.

Impact

The CVSS 4.0 base score of 5.3 (Medium, vector AV:N/AC:L/AT:N/PR:N/UI:P) characterizes this as network-accessible with low attack complexity and no privilege requirements, but dependent on user interaction. The VC:L/VI:L/SC:L/SI:L impact metrics reflect limited but real confidentiality and integrity bypass on both the vulnerable and subsequent-system surfaces, consistent with XSS enablement rather than full remote code execution. No EPSS score was provided in the source data; exploitation probability cannot be independently quantified. The vulnerability is not in CISA KEV, and no confirmed POC exists at time of analysis. Real-world risk is substantially mediated by the attack precondition: the target application must have an installed hook that writes to data.allowedTags or data.allowedAttributes, a pattern that, while natural-looking, is not universal across all DOMPurify deployments. However, the insidious nature of the state corruption - which cannot be cleared by removeAllHooks(), clearConfig(), or passing a fresh cfg, and requires constructing an entirely new DOMPurify instance - means applications unaware of the issue cannot self-recover through conventional remediation patterns. Given DOMPurify's broad deployment in content-rendering pipelines, any application with the requisite hook pattern is silently at persistent XSS risk.

Exploit ScenarioDerived

An attacker targets a web application using DOMPurify with a uponSanitizeElement hook that writes data.allowedTags['script'] = true during a legitimate conditional rendering flow (e.g., to allow a custom element for a specific trusted content type). Once that hook executes once - triggered by any sanitize() call processing content that includes the relevant element - the global DEFAULT_ALLOWED_TAGS set is permanently widened to include 'script'. From that point forward, all subsequent sanitize() calls on the same DOMPurify instance, including those processing user-submitted comment or profile content, will pass through <script> tags, enabling stored XSS that executes in every visiting user's browser. No public exploit code has been identified at time of analysis.

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

Hook mutation pollution in DOMPurify <= 3.4.5 allows persistent bypass of HTML sanitization defaults when application-installed hooks mutate data.allowedTags or data.allowedAttributes. Because these hook fields are direct references to the library's live DEFAULT_ALLOWED_TAGS and DEFAULT_ALLOWED_ATTR sets rather than copies, any write inside a uponSanitizeElement or uponSanitizeAttribute hook permanently widens the global allow-lists for the entire lifetime of the DOMPurify instance - meaning all subsequent sanitize() calls under default config will pass through attacker-controlled HTML using the poisoned tag or attribute name. No public exploit has been identified at time of analysis, and this vulnerability is not listed in CISA KEV; real-world risk is gated on the presence of the specific hook mutation pattern in the target application.

RemediationAI

Upgrade DOMPurify to version 3.4.7 or later, which contains the defensive clone fix from commit 7996f1dc78eb8b7922388aed75d94a9f8fad9a36 (https://github.com/cure53/DOMPurify/commit/7996f1dc78eb8b7922388aed75d94a9f8fad9a36). Install via npm with npm install dompurify@3.4.7. The vendor advisory is at https://github.com/cure53/DOMPurify/security/advisories/GHSA-76mc-f452-cxcm. If immediate upgrade is not feasible, two workarounds exist with trade-offs: (1) Refactor all uponSanitizeElement and uponSanitizeAttribute hooks to avoid writing to data.allowedTags or data.allowedAttributes entirely - instead, pass an explicit cfg.ALLOWED_TAGS or cfg.ALLOWED_ATTR array to every sanitize() call so the live DEFAULT sets are never used as the reference base; this requires audit of all hook implementations and callers. (2) Construct a fresh DOMPurify instance for each sanitization context that requires different allow-lists, discarding instances after hook-mutating operations - this trades object allocation cost for state isolation. Note that removeAllHooks(), clearConfig(), and passing a fresh cfg object do NOT remediate already-poisoned state; only a new instance does.

Affected VersionsENISA

DOMPurify 0 <3.4.7

Affected Packages

npm dompurify fix: 3.4.7

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 (npm: dompurify, cure53/DOMPurify, CPE: cpe:2.3:a:cure53:dompurify:*:*:*:*:*:*:*:*) is the dominant client-side HTML sanitization library for JavaScript. The flaw resides in the hook execution paths at src/purify.ts lines 1206-1209 (uponSanitizeElement) and 1494-1500 (uponSanitizeAttribute), where ALLOWED_TAGS and ALLOWED_ATTR are passed to hook callbacks as direct object references rather than defensive copies. When sanitize() is called without explicit cfg.ALLOWED_TAGS or cfg.ALLOWED_ATTR, the live sets themselves are direct references to the module-level DEFAULT_ALLOWED_TAGS and DEFAULT_ALLOWED_ATTR constants, completing the reference chain from hook callback to global constant. CWE-501 (Trust Boundary Violation) applies because a hook-scoped mutation leaks across the trust boundary into the global default state; CWE-693 (Protection Mechanism Failure) applies because the core protection mechanism - the default allow-list - is silently widened for all callers without any indication. The advisory notes the maintainer had already implemented a defensive clone at purify.ts:696-700 for the cfg.ADD_TAGS code path, demonstrating awareness of this class of bug; the hook path was the gap. The fix in 3.4.7 (commit 7996f1dc) closes this gap by cloning the sets before passing them to hook callbacks.

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

AC:H reflects the specific hook mutation precondition required; S:C because poisoning crosses trust boundary to affect all subsequent instance callers.

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:L/VI:L/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
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

DescriptionCVE.org

DOMPurify before 3.4.7 (affected versions <= 3.4.5) passes direct references to the module-level DEFAULT_ALLOWED_TAGS and DEFAULT_ALLOWED_ATTR sets to the uponSanitizeElement and uponSanitizeAttribute hooks via data.allowedTags / data.allowedAttributes when sanitize is called without an explicit cfg.ALLOWED_TAGS / cfg.ALLOWED_ATTR array. A hook that mutates these fields permanently widens the default allow-lists for the lifetime of the DOMPurify instance, so all subsequent default-config sanitize calls inherit the widened defaults and attacker payloads using the poisoned tag/attribute name survive sanitization. removeAllHooks(), clearConfig(), and passing a fresh cfg do not recover the state; only constructing a new DOMPurify instance does.

Blast Radius

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

Ecosystem-wide dependent count for version 3.4.7.

Threat Intelligence Overview

EPSS Score
0.2%
Top 90% exploitable
Prevalence
High
dominant HTML sanitization library in JavaScript web ecosystem
Exploit
POC
Public exploit code exists
Data Quality
7 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
Poc
System Exposure· derived
Open
Automatable
No
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-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

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