Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify app using ADD_TAGS function form with FORBID_TAGS overlap
-
DeliveryCraft HTML containing FORBID_TAGS-listed element
-
ExploitSubmit crafted payload as user-supplied content
-
ExecutionDOMPurify short-circuits, retains forbidden tag in sanitized output
-
PersistApplication renders sanitized output in browser
-
ImpactForbidden tag executes, achieving XSS or injection
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Incorrect comparison
|
| Exploitation Conditions | Exploitation requires the target application to configure DOMPurify with ADD_TAGS in its function/callback form (specifically via EXTRA_ELEMENT_HANDLING.tagCheck), AND to specify overlapping entries in FORBID_TAGS for tags that the callback would approve. This is a non-default, advanced usage pattern; applications using ADD_TAGS as a plain array (the common case) are entirely unaffected. CVSS UI:A (active user interaction) confirms that user-submitted input must be processed and the resulting sanitized HTML must be rendered in a browser context. Exploitation is limited to: (1) DOMPurify versions <= 3.3.3; (2) the function form of ADD_TAGS, not the array form; (3) applications that also set FORBID_TAGS on overlapping tags; and (4) a browser-rendering context where the retained forbidden tag is meaningful. Authentication requirements are not confirmed from available data - the attacker's ability to submit input depends entirely on the application's own access controls. |
| Impact | The provided CVSS 4.0 score of 5.1 with SC:L/SI:L captures the real-world impact reasonably well: this is a subsequent-system (browser/renderer) integrity and confidentiality issue, not a direct server-side compromise. UI:A correctly reflects that a user or process must submit crafted input and render the output. The most critical limiting factor not fully reflected in that score is attack complexity: exploitation requires a very specific, non-default configuration where ADD_TAGS is used in its function callback form (not the common array form) AND the same tags appear in FORBID_TAGS - the advisory itself labels this 'Config-dependent.' No EPSS score was provided; no KEV listing exists. No public proof-of-concept has been identified in the provided intelligence. Real-world risk is therefore low-to-medium despite the library's broad deployment: the majority of DOMPurify consumers use ADD_TAGS as a plain array, which is entirely unaffected. Applications combining the function form with explicit FORBID_TAGS for the same tags - a defensive pattern suggesting heightened security intent - paradoxically bear the highest risk. |
| Exploit ScenarioDerived | A developer configures DOMPurify with ADD_TAGS as a tagCheck callback that approves custom elements and also sets FORBID_TAGS to block specific tags (e.g., 'script' or a custom dangerous element). An attacker submits crafted HTML containing one of those forbidden-but-ADD_TAGS-approved tags; DOMPurify's short-circuit logic retains the tag in sanitized output. When the application renders that output in a browser, the forbidden tag executes - enabling XSS, data exfiltration, or UI redress depending on the tag type. No public PoC is available, but the advisory provides enough detail for an experienced researcher to reproduce the issue. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 23, 2026
DOMPurify versions up to and including 3.3.3 incorrectly resolves a tag-allow conflict when ADD_TAGS is used in its function form alongside FORBID_TAGS, causing forbidden tags to survive sanitization. The flaw is a short-circuit evaluation error in purify.ts (lines 1117-1123): when the ADD_TAGS callback (tagCheck) returns true for a tag, the Boolean AND short-circuits, meaning FORBID_TAGS is never consulted - directly contradicting the attribute-side behavior where FORBID_ATTR always wins. An attacker who can supply HTML to an application using this specific configuration can inject tags the developer explicitly intended to block, leading to XSS or related injection in whatever context the sanitized output is rendered. No public exploit code has been identified and the vulnerability is not listed in CISA KEV at time of analysis.
RemediationAI
Vendor-released patch: DOMPurify 3.4.0. Upgrade via npm (npm install dompurify@3.4.0 or npm install dompurify@latest) or update the lockfile pinning. The fix restructures the tag-check condition to evaluate FORBID_TAGS before tagCheck, consistent with the attribute-side pattern. See the GitHub advisory GHSA-39q2-94rc-95cp at https://github.com/cure53/DOMPurify/security/advisories/GHSA-39q2-94rc-95cp for patch details. If immediate upgrade is not possible, the most effective workaround is to stop using ADD_TAGS as a function (EXTRA_ELEMENT_HANDLING.tagCheck) and convert to the array form of ADD_TAGS - this entirely avoids the vulnerable code path with no functional side effects for most use cases. If the function form is required, move FORBID_TAGS enforcement into a post-sanitization step that strips the relevant tags from DOMPurify output, noting that post-processing introduces a second parse and its own risk of parser differential. Do not rely on FORBID_TAGS alone for security guarantees in configurations using the function ADD_TAGS form on versions <= 3.3.3.
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 (npm: dompurify, CPE cpe:2.3:a:cure53:dompurify:*:*:*:*:*:*:*:*) is the dominant HTML sanitization library in the JavaScript ecosystem, authored by cure53. Its core sanitization loop evaluates each parsed tag against allow/block lists to produce safe output. The vulnerability manifests specifically in EXTRA_ELEMENT_HANDLING.tagCheck - the function form of ADD_TAGS - where the composite Boolean condition !(tagCheck(tagName)) && (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) short-circuits: a truthy tagCheck result makes the outer AND false, so the element is kept and FORBID_TAGS is never evaluated. The attribute side (line 1214) correctly places if (FORBID_ATTR[lcName]) { continue; } first, creating an asymmetric inconsistency. CWE-697 (Incorrect Comparison) describes the root cause precisely - the comparison logic produces the wrong truth value in the overlapping ADD_TAGS-function + FORBID_TAGS case, not a missing check but a logically incorrect ordering of operands.
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 the non-default configuration prerequisite (ADD_TAGS function form plus overlapping FORBID_TAGS); S:C and C:L/I:L capture downstream XSS impact in the browser rendering context.
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
DOMPurify before 3.4.0 contains a logic error in the ADD_TAGS function where short-circuit evaluation allows forbidden tags to bypass FORBID_TAGS restrictions. Attackers can craft input containing tags listed in FORBID_TAGS that are also added via ADD_TAGS function, causing them to be retained in sanitized output.
Blast Radius
ecosystem impact- 62 npm packages depend on dompurify (32 direct, 30 indirect)
Ecosystem-wide dependent count for version 3.4.0.
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
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
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
Trusted Types policy state contamination in DOMPurify 3.0.0-3.4.8 allows a previously supplied TRUSTED_TYPES_POLICY to s
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
Same weakness CWE-697 – Incorrect Comparison
View allSame technique Authentication Bypass
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-48272
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB