MODERATE 6.1

CVE-2026-65913

DOMPurify USE_PROFILES prototype pollution allows event handlers

Description

Summary

When USE_PROFILES is enabled, DOMPurify rebuilds ALLOWED_ATTR as a plain array before populating it with the requested allowlists. Because the sanitizer still looks up attributes via ALLOWED_ATTR[lcName], any Array.prototype property that is polluted also counts as an allowlisted attribute. An attacker who can set Array.prototype.onclick = true (or a runtime already subject to prototype pollution) can thus force DOMPurify to keep event handlers such as onclick even when they are normally forbidden. The provided PoC sanitizes <img onclick=...> with USE_PROFILES and adds the sanitized output to the DOM; the polluted prototype allows the event handler to survive and execute, turning what should be a blocklist into a silent XSS vector.

Impact

Prototype pollution makes DOMPurify accept dangerous event handler attributes, which bypasses the sanitizer and results in DOM-based XSS once the sanitized markup is rendered.

Credits

Identified by Cantina’s Apex (https://www.cantina.security).

Affected Maven artifacts (2)

ArtifactAffected versionsFixed in
org.mvnpm » dompurifyvia npm dompurify
< 3.3.2
3.3.2
org.webjars.npm » dompurifyvia npm dompurify
< 3.3.2
3.3.2

Blast radius

2affected artifacts
77affected versions
51dependent artifacts (est.)
1,375dependent versions

33% of the dependent artifacts (17) still pull an affected version in their latest release.

DepthDependent versions
Direct
164
2 hops
532
3 hops
429
4 hops
130
5 hops
120

Most used dependents

Computed from the dependency graph of build 20261125.2201 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.

Other ecosystems

Also affects npm (1 package) . See all on OSV