Description
In DOMPurify through 3.3.3, function predicates supplied via ADD_ATTR or ADD_TAGS to DOMPurify.sanitize() persist in internal state (EXTRA_ELEMENT_HANDLING) across subsequent sanitize() calls on the same instance. If a later call on the same instance provides ADD_ATTR or ADD_TAGS as an array rather than a function, the previously set function handler is neither cleared nor overwritten, so it continues to approve attacker-controlled attributes or tags. This can allow dangerous event-handler attributes or forbidden tags (bypassing FORBID_TAGS) to survive sanitization, resulting in cross-site scripting. The vendor (Cure53) considers this an edge case outside DOMPurify's threat model; the referenced advisory lists 3.4.0 as the patched version.
Published: 2026-07-23
Score: 5.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

DOMPurify versions prior to 3.4.0 allow a state leakage flaw whereby function predicates supplied to ADD_ATTR or ADD_TAGS persist across multiple calls to the same sanitizer instance. When a subsequent sanitize() call supplies an array instead of a function for these options, the previously set function is neither cleared nor overwritten, allowing it to continue approving attacker‑controlled attributes or tags. This persistence permits dangerous event‑handler attributes or forbidden tags that would normally be removed to survive sanitization, resulting in cross‑site scripting when the cleaned content is rendered.

Affected Systems

Affected: the DOMPurify library released by Cure53, specifically all versions up to and including 3.3.3. Developers and organizations that embed this client‑side JavaScript library to sanitise user‑supplied HTML in web applications are impacted. No native platform versions are included; the vulnerability exists only in the JavaScript implementation of DOMPurify.

Risk and Exploitability

Risk and potential exploitation: The CVSS score of 5.1 classifies the flaw as moderate. The EPSS score of less than 1 % indicates a very low likelihood of exploitation. The vulnerability is not listed in the CISA KEV catalog. Based on the description, it is inferred that an attacker would need to supply malicious input through repeated calls to the same DOMPurify instance, a scenario that can occur in single‑page applications or frameworks that cache the sanitizer. While the flaw does not allow arbitrary code execution or server compromise, successful exploitation results in cross‑site scripting that can deface the user interface, exfiltrate user data, or hijack sessions if the malicious script has sufficient privileges.

Generated by OpenCVE AI on August 3, 2026 at 21:31 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade DOMPurify to version 3.4.0 or later.
  • Instantiate a fresh DOMPurify instance for each sanitize() call or clear the instance’s internal state after use.
  • If upgrading is not possible, avoid passing non‑function arrays to ADD_ATTR or ADD_TAGS, or explicitly set these options to null before subsequent sanitize() calls to prevent leakage.

Generated by OpenCVE AI on August 3, 2026 at 21:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 29 Jul 2026 08:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Thu, 23 Jul 2026 13:30:00 +0000

Type Values Removed Values Added
Description In DOMPurify through 3.3.3, function predicates supplied via ADD_ATTR or ADD_TAGS to DOMPurify.sanitize() persist in internal state (EXTRA_ELEMENT_HANDLING) across subsequent sanitize() calls on the same instance. If a later call on the same instance provides ADD_ATTR or ADD_TAGS as an array rather than a function, the previously set function handler is neither cleared nor overwritten, so it continues to approve attacker-controlled attributes or tags. This can allow dangerous event-handler attributes or forbidden tags (bypassing FORBID_TAGS) to survive sanitization, resulting in cross-site scripting. The vendor (Cure53) considers this an edge case outside DOMPurify's threat model; the referenced advisory lists 3.4.0 as the patched version.
Title DOMPurify before 3.4.0 XSS via ADD_ATTR/ADD_TAGS State Leakage
First Time appeared Cure53
Cure53 dompurify
Weaknesses CWE-79
CPEs cpe:2.3:a:cure53:dompurify:*:*:*:*:*:*:*:*
Vendors & Products Cure53
Cure53 dompurify
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 5.1, 'vector': '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'}


Subscriptions

Cure53 Dompurify
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-27T16:20:37.732Z

Reserved: 2026-07-23T12:51:09.595Z

Link: CVE-2026-65911

cve-icon Vulnrichment

Updated: 2026-07-27T16:15:28.849Z

cve-icon NVD

Status : Analyzed

Published: 2026-07-23T14:18:06.260

Modified: 2026-07-28T15:50:57.303

Link: CVE-2026-65911

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T21:45:03Z

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')