Duplicate Advisory: DOMPurify: `CUSTOM_ELEMENT_HANDLING` bypasses `afterSanitizeElements` for allowed custom elements.
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.
AI Analysis
Technical Summary
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.
Duplicate Advisory: DOMPurify: `CUSTOM_ELEMENT_HANDLING` bypasses `afterSanitizeElements` for allowed custom elements.
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
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
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.
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 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.