CVE-2026-66010: DOMPurify · `CUSTOM_ELEMENT_HANDLING` bypasses `afterSanitizeElements` for allowed custom elements
Affects dompurifySource GCVE Database
Mentioned vulnerabilities
CVSS 2.1 Low : upgrade to 3.4.12 when convenient.
Data as of 3 Oct 2026, 18:24 UTC
- Patch
- Available – fixed in 3.4.12
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:NWhat to do
Upgrade dompurify to 3.4.12.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npmdompurify | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available in DOMPurify version 3.4.12 that addresses this issue. Users should upgrade to version 3.4.12 or later to ensure that allowed custom elements are properly sanitized and the afterSanitizeElements hook is applied consistently. No additional mitigation is required if the update is applied.
Description
DOMPurify 3.4.11 has a hook-policy inconsistency involving the CUSTOM_ELEMENT_HANDLING configuration. Allowed custom elements bypass the afterSanitizeElements hook, which may cause sensitive attributes to be preserved on these elements while being removed from normal elements. This can lead to a second-order XSS vulnerability if the custom element later injects these attributes into an HTML sink such as innerHTML. This is not a direct DOMPurify XSS but a potential security policy bypass. A fix is available in versions 3.4.12 and later.
References
- github.com/cure53/DOMPurify/security/advisories/GHSA-c2j3-45gr-mqc4 (opens in a new tab)
- github.com/cure53/DOMPurify/pull/1537 (opens in a new tab)
- github.com/cure53/DOMPurify/commit/a9ca1e537422319a557a9a2aa61f003b23b4a197 (opens in a new tab)
- github.com/cure53/DOMPurify (opens in a new tab)
- github.com/cure53/DOMPurify/releases/tag/3.4.12 (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2026-66010 (opens in a new tab)
- vulncheck.com/advisories/dompurify-before-hook-bypass-via-custom-element-handling (opens in a new tab)