CVE-2026-65911

DOMPurify before 3.4.0 XSS via ADD_ATTR/ADD_TAGS State Leakage

Published Jul 23, 2026 CVSS 4.0 · 5.1 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

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

Remediation

No solution or workaround provided in the CVE record.

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 available
History
Type Values Removed Values Added
Metrics ssvc

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

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

Weaknesses
  • CWE-79

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

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Jul 27, 2026, 4:20 PM
Reserved
Jul 23, 2026, 12:51 PM
Status
Analyzed
Published
Jul 23, 2026, 2:18 PM
Modified
Oct 24, 2026, 1:10 PM