Junglewise Threat Intelligence

CVE-2026-65902: cure53 DOMPurify global allow-list pollution via hook mutation

CVE-2026-65902 · Severity: medium · CVSS 6.1 · Published 2026-07-23

Technologies: dompurify (npm). Vendors: npm.

Executive brief

DOMPurify is a security library used to clean HTML and prevent malicious scripts from running in web browsers. A flaw in how the library handles custom rules (hooks) allows a developer's temporary settings to accidentally become permanent for the life of the application. This means that if a specific tag or attribute is allowed once, it may remain allowed for all future users, potentially allowing an attacker to bypass security filters and execute malicious code.

Technical details

DOMPurify (versions <= 3.4.5) suffers from a trust boundary violation where the 'uponSanitizeElement' and 'uponSanitizeAttribute' hooks receive direct references to the internal DEFAULT_ALLOWED_TAGS and DEFAULT_ALLOWED_ATTR sets. When a developer mutates these sets within a hook (e.g., data.allowedTags['script'] = true), the change persists globally for the DOMPurify instance because the library fails to clone the default configuration before passing it to the hook. Consequently, subsequent calls to sanitize() using the default configuration will inherit these widened allow-lists, enabling Cross-Site Scripting (XSS) via the poisoned tags or attributes. Standard cleanup methods like removeAllHooks() or clearConfig() do not resolve the state; only a fresh library instance or upgrading to version 3.4.7 mitigates the issue.

Affected products

  • cure53 DOMPurify <= 3.4.5

Timeline

  • 2026-05-26: advisory: GitHub Security Advisory published by maintainer
  • 2026-07-23: disclosed: CVE published to NVD

References

Related threats