Duplicate Advisory: DOMPurify: `CUSTOM_ELEMENT_HANDLING` bypasses `afterSanitizeElements` for allowed custom elements
Affects dompurifySource GCVE Database
CVSS 6.1 Medium · fixed in 3.4.12 : update dompurify when convenient.
Data as of 3 Oct 2026, 17:40 UTC
- Patch
- Available – fixed in 3.4.12
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:NWhat to do
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 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.
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.