Skip to main content

DOMPurify: `CUSTOM_ELEMENT_HANDLING` bypasses `afterSanitizeElements` for allowed custom elements. (CVE-2026-66010)

0
Low
Published: 07/21/2026 (07/21/2026, 19:41:07 UTC)
Source: GCVE Database
Product: dompurify

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.

CVSS v4.0

Attack Vector
Network
Attack Complexity
High
Attack Requirements
None
Privileges Required
None
User Interaction
Active
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
None
Subsq. Confidentiality
Low
Subsq. Integrity
Low
Subsq. Availability
None
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Affected software

npmghsa
dompurify
Affected versions
<3.4.12

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/03/2026, 18:24:55 UTC

Technical Analysis

In DOMPurify version 3.4.11, when a custom element is allowed via the CUSTOM_ELEMENT_HANDLING.tagNameCheck configuration, the element bypasses the afterSanitizeElements hook. The sanitization function _sanitizeDisallowedNode returns early for allowed custom elements, skipping subsequent sanitization steps including namespace validation and fallback-tag mXSS checks. As a result, sensitive attributes that would normally be stripped by afterSanitizeElements remain on these custom elements. While the preserved attribute values are inert during initial sanitization, they may be re-injected into HTML sinks later, creating a second-order XSS vector. This vulnerability is due to a control flow inconsistency in the sanitization logic and affects versions prior to 3.4.12.

Potential Impact

Applications relying on DOMPurify 3.4.11 with CUSTOM_ELEMENT_HANDLING to sanitize HTML and strip sensitive attributes may have those attributes preserved on allowed custom elements. This can lead to second-order cross-site scripting (XSS) if the custom elements later inject these attributes into HTML sinks such as innerHTML. The vulnerability does not allow direct execution of payloads during sanitization but creates a potential security bypass in the sanitization policy.

Mitigation Recommendations

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-c2j3-45gr-mqc4
Osv Schema Version
1.4.0
Ecosystems
["npm"]
Database Specific Severity
LOW
Cvss Version
4.0

Threat ID: 6a600ac39c2644c7f8fe33be

Added to database: 07/22/2026, 00:11:47 UTC

Last enriched: 10/03/2026, 18:24:55 UTC

Last updated: 10/03/2026, 18:24:55 UTC

Views: 155

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses