CVE-2026-66010

DOMPurify before 3.4.12 Hook Bypass via CUSTOM_ELEMENT_HANDLING

Published Jul 24, 2026 CVSS 4.0 · 5.1 Medium EPSS < 1% KEV · Not listed
Description
DOMPurify before 3.4.12 fails to execute afterSanitizeElements hook for custom elements allowed via CUSTOM_ELEMENT_HANDLING.tagNameCheck, allowing attributes to bypass application security policies. Attackers can preserve sensitive attributes on custom elements that later re-inject them into innerHTML sinks, creating second-order XSS gadgets.

Analysis

AI-generated

Technical impact

DOMPurify versions prior to 3.4.12 contain a flaw that prevents the afterSanitizeElements hook from running on custom elements permitted by the CUSTOM_ELEMENT_HANDLING.tagNameCheck setting. As a result, attributes set on those elements remain untouched and can later be re‑injected into innerHTML sinks, enabling an attacker to create a second‑order XSS gadget. The vulnerability is a classic Cross‑Site Scripting flaw (CWE‑79).

Affected Systems

The affected library is DOMPurify from cure53. Vulnerable versions include all releases before 3.4.12. The library is widely used in web applications for sanitizing HTML. No vendor version list is provided beyond the cutoff; administrators should examine any deployment of DOMPurify earlier than 3.4.12.

Risk and Exploitability

The CVSS score of 5.1 indicates a moderate severity. The EPSS score of less than 1% suggests low current exploitation probability, and the vulnerability is not listed in CISA KEV. The attack is client‑side, requiring an attacker to supply crafted input that is later injected into the browser’s innerHTML, thus leading to XSS. While exploitation may not be widespread, any application that sanitizes input with a vulnerable DOMPurify version is at risk of subsequent script execution if custom element attributes survive sanitization.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade DOMPurify to version 3.4.12 or later
  • If an upgrade is not immediately possible, disable CUSTOM_ELEMENT_HANDLING or remove tagNameCheck to prevent custom elements from bypassing sanitization
  • Implement additional server‑side validation or attribute whitelisting to ensure that custom element attributes do not escape into innerHTML sinks

Generated by OpenCVE AI on August 3, 2026 at 20:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-c2j3-45gr-mqc4 DOMPurify: `CUSTOM_ELEMENT_HANDLING` bypasses `afterSanitizeElements` for allowed custom elements.
History
Type Values Removed Values Added
Description DOMPurify before 3.4.12 fails to execute afterSanitizeElements hook for custom elements allowed via CUSTOM_ELEMENT_HANDLING.tagNameCheck, allowing attributes to bypass application security policies. Attackers can preserve sensitive attributes on custom elements that later re-inject them into innerHTML sinks, creating second-order XSS gadgets.
Title DOMPurify before 3.4.12 Hook Bypass via CUSTOM_ELEMENT_HANDLING
First Time appeared Cure53
Cure53 dompurify
Weaknesses CWE-79
CPEs cpe:2.3:a:cure53:dompurify:*:*:*:*:*:*:*:*
Vendors & Products Cure53
Cure53 dompurify
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Sep 17, 2026, 5:54 PM
Reserved
Jul 23, 2026, 7:22 PM
Status
Analyzed
Published
Jul 24, 2026, 1:18 PM
Modified
Oct 24, 2026, 1:10 PM
Severity
Moderate
Public date
Jul 24, 2026, 12:07 PM