Description
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.
Published: 2026-07-23
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

DOMPurify versions prior to 3.4.7 expose their internal DEFAULT_ALLOWED_TAGS and DEFAULT_ALLOWED_ATTR sets to the uponSanitizeElement and uponSanitizeAttribute hooks when no explicit configuration is supplied. A hook that mutates these fields permanently broadens the allowed lists, so subsequent sanitize calls inherit the widened defaults. This flaw is an input‑validation weakness identified as CWE‑501 and enables an attacker to inject a tag or attribute that survives sanitization and executes client‑side script. The impact is a cross‑site scripting vulnerability that can persist across multiple calls within the same runtime.

Affected Systems

All applications that embed any DOMPurify <=3.4.5 library, especially those that rely on the default configuration, or that register custom hooks that may alter DEFAULT_ALLOWED_TAGS or DEFAULT_ALLOWED_ATTR. The issue does not affect versions 3.4.6 or later, which have been patched to prevent mutation of the default sets.

Risk and Exploitability

The likely attack vector is any client‑side context where an attacker‑controlled hook can be registered—such as a malicious plugin, a compromised script bundle, or a user‑supplied component that directly calls DOMPurify. Once the default lists are mutated, all future sanitizations, even with default settings, will accept the poisoned tags, leading to persistent cross‑site scripting. The CVSS score of 5.3 indicates moderate severity; the EPSS score of less than 1% suggests exploitation is currently unlikely, and the vulnerability is not listed in CISA KEV. However, any environment that allows hook registration presents a potential attack surface.

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

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to DOMPurify 3.4.7 or later, where the default list mutation bug has been fixed.
  • If an upgrade is not immediately available, avoid using hooks that modify DEFAULT_ALLOWED_TAGS or DEFAULT_ALLOWED_ATTR and create a fresh DOMPurify instance before each sanitization request.
  • Review any custom hook logic for inadvertent mutation of the global allow‑lists and ensure that hooks only read from, not write to, the defaults.

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

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-76mc-f452-cxcm DOMPurify: Hook mutation of `data.allowedTags` / `data.allowedAttributes` permanently pollutes `DEFAULT_ALLOWED_TAGS` / `DEFAULT_ALLOWED_ATTR`
History

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

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


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

Type Values Removed Values Added
Description 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.
Title DOMPurify before 3.4.7 Hook Mutation Pollution via allowedTags
First Time appeared Cure53
Cure53 dompurify
Weaknesses CWE-501
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.3, 'vector': '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'}


Subscriptions

Cure53 Dompurify
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-24T21:35:25.085Z

Reserved: 2026-07-23T11:03:13.092Z

Link: CVE-2026-65902

cve-icon Vulnrichment

Updated: 2026-07-23T13:58:28.203Z

cve-icon NVD

Status : Analyzed

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

Modified: 2026-07-28T15:51:48.907

Link: CVE-2026-65902

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

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

Weaknesses