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

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

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.

Technologies: dompurify (npm). Vendors: npm.

Quick answers

Is CVE-2026-65902 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-65902 being exploited in the wild.
How severe is CVE-2026-65902?
Medium severity, with a CVSS score of 6.1, published 23 July 2026.
Which products and versions are affected?
dompurify (npm) SEMVER:introduced=0,fixed=3.4.7.
Is there a fix for CVE-2026-65902?
Yes. dompurify (npm): upgrade to 3.4.7 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-65902 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-65902?
Check whether you run dompurify (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • dompurify (npm): upgrade to 3.4.7 or later
    npm install dompurify@3.4.7

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

Identifiers

  • CVE-2026-65902
  • GHSA-76mc-f452-cxcm

Timeline

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

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.