Skip to main content

Duplicate Advisory: DOMPurify: `CUSTOM_ELEMENT_HANDLING` bypasses `afterSanitizeElements` for allowed custom elements.

0
Medium
Published: 07/24/2026 (07/24/2026, 15:33:01 UTC)
Source: GCVE Database
Product: dompurify

Description

DOMPurify versions before 3.4.12 have a vulnerability where the afterSanitizeElements hook is not executed for custom elements allowed via CUSTOM_ELEMENT_HANDLING.tagNameCheck. This allows attributes on these custom elements to bypass security policies, potentially enabling second-order cross-site scripting (XSS) attacks by preserving sensitive attributes that are later re-injected into innerHTML sinks.

CVSS v3.1

Score 6.1medium

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Affected software

npmghsa
dompurify
Affected versions
<=3.4.11

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, 17:40:29 UTC

Technical Analysis

DOMPurify before version 3.4.12 fails to execute the afterSanitizeElements hook for custom elements permitted through the CUSTOM_ELEMENT_HANDLING.tagNameCheck mechanism. This failure allows attributes on these custom elements to bypass application security policies. Attackers can exploit this to preserve sensitive attributes on custom elements, which may later be re-injected into innerHTML sinks, creating second-order XSS gadgets. The vulnerability is identified as CWE-79 (Improper Neutralization of Input During Web Page Generation).

Potential Impact

The vulnerability allows attackers to bypass security policies by preserving attributes on allowed custom elements, which can lead to second-order XSS attacks when these attributes are re-inserted into the DOM via innerHTML. This can result in partial compromise of confidentiality and integrity but does not affect availability. The CVSS score is 6.1 (medium severity), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, and scope changed with limited confidentiality and integrity impact.

Mitigation Recommendations

A fix is available in DOMPurify version 3.4.12. Users should upgrade to version 3.4.12 or later to ensure the afterSanitizeElements hook is properly executed for custom elements allowed via CUSTOM_ELEMENT_HANDLING.tagNameCheck. No other mitigation is indicated.

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-jxrp-r7gx-q4j8
Osv Schema Version
1.4.0
Ecosystems
["npm"]
Database Specific Severity
MODERATE
Cvss Version
3.1

Threat ID: 6ac139b2a43b0b3b89d69af4

Added to database: 10/03/2026, 17:21:54 UTC

Last enriched: 10/03/2026, 17:40:29 UTC

Last updated: 10/04/2026, 02:49:10 UTC

Views: 9

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