# CVE-2026-66010: DOMPurify hook bypass in CUSTOM_ELEMENT_HANDLING

Source: https://junglewise.ai/threats/cve-2026-66010-dompurify-hook-bypass-in-custom-element-handling  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-24. Updated: 2026-07-24  
License: CC BY 4.0 with a link back

CVE-2026-66010 · Severity: medium · CVSS 6.1 · Published 2026-07-24

DOMPurify is a popular library used to clean HTML and prevent malicious code from running in web applications. A flaw was found where certain custom HTML elements could bypass security checks designed to strip out dangerous attributes. If an application uses these custom elements and later processes their data, an attacker could potentially execute malicious scripts (Cross-Site Scripting), leading to unauthorized actions or data theft.

Technologies: [dompurify (npm)](https://junglewise.ai/threats/technologies/dompurify). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-66010 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-66010 being exploited in the wild.

**How severe is CVE-2026-66010?** Medium severity, with a CVSS score of 6.1, published 24 July 2026.

**Which products and versions are affected?** dompurify (npm) SEMVER:introduced=0,fixed=3.4.12.

**Is there a fix for CVE-2026-66010?** Yes. dompurify (npm): upgrade to 3.4.12 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-66010 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-66010?** 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.12 or later

  ```sh
  npm install dompurify@3.4.12
  ```


## Technical details

A logic flaw in DOMPurify's `_sanitizeDisallowedNode` function causes an early return when a custom element is validated via `CUSTOM_ELEMENT_HANDLING.tagNameCheck`. This early return bypasses subsequent sanitization steps in `_sanitizeElements`, specifically the execution of the `afterSanitizeElements` hook. If an application relies on this hook to enforce security policies (such as stripping sensitive attributes), those attributes will be preserved on custom elements. While the attributes remain inert during the initial sanitization, they can serve as second-order XSS gadgets if the application later re-injects the preserved attribute values into a dangerous sink like `innerHTML`. The issue is fixed in version 3.4.12.

## Affected products

- cure53 DOMPurify < 3.4.12

## Identifiers

- CVE-2026-66010
- GHSA-c2j3-45gr-mqc4

## Timeline

- 2026-07-11: advisory: GitHub Security Advisory GHSA-c2j3-45gr-mqc4 published
- 2026-07-24: disclosed: CVE-2026-66010 published to NVD

## References

- [https://github.com/cure53/DOMPurify/security/advisories/GHSA-c2j3-45gr-mqc4](https://github.com/cure53/DOMPurify/security/advisories/GHSA-c2j3-45gr-mqc4)
- [https://www.vulncheck.com/advisories/dompurify-before-hook-bypass-via-custom-element-handling](https://www.vulncheck.com/advisories/dompurify-before-hook-bypass-via-custom-element-handling)

## Related threats

- [DOMPurify SAFE_FOR_TEMPLATES bypass in shadow root content](https://junglewise.ai/threats/dompurify-safe-for-templates-bypass-split-template-expressions-survive-c23665cf)
- [DOMPurify IN_PLACE event handler bypass when hook removes parent or sibling](https://junglewise.ai/threats/dompurify-in-place-hook-that-removes-a-parent-or-sibling-leaves-the-3ea5d18f)
- [DOMPurify SMIL attributeName=href guard bypass in XHTML mode](https://junglewise.ai/threats/dompurify-smil-attributename-href-guard-is-skipped-when-parser-media-15a5efd2)
- [DOMPurify IN_PLACE mode XSS via rawtext element text content](https://junglewise.ai/threats/dompurify-in-place-returns-a-force-removed-rawtext-root-whose-text-16d9ac9e)
- [DOMPurify DOM XSS in IN_PLACE mode with afterSanitize hooks](https://junglewise.ai/threats/dompurify-in-place-node-removing-aftersanitize-hook-leaves-detached-3087e7fd)
