Skip to main content
VulnerabilityPublished Updated

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

Affects dompurifySource GCVE Database

0

CVSS 6.1 Medium · fixed in 3.4.12 : update dompurify when convenient.

Data as of 3 Oct 2026, 17:40 UTC

CVSS 3.1 base score
6.1Medium
How severe the flaw is on the 0–10 CVSS scale.
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:N

What to do

Affected software

ProductAffectedFixed in
npmdompurifyAffected
  • <=3.4.11
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.

References

Community reviews

Loading reviews…