Description
DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Prior to 3.4.7, DOMPurify IN_PLACE sanitization could skip shadow contents attached to an element inside <template>.content, allowing attacker-controlled markup such as event handlers, JavaScript URLs, or scripts to survive and execute when an application cloned and inserted the sanitized template. This issue is fixed in version 3.4.7.
Published: 2026-07-14
Score: 6.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

DOMPurify is a DOM‑only cross‑site scripting sanitizer for HTML, MathML, and SVG. Prior to 3.4.7, DOMPurify IN_PLACE sanitization could skip shadow contents attached to an element inside a <template>.content, allowing attacker‑controlled markup such as event handlers, JavaScript URLs, or scripts to survive sanitization. When an application clones and inserts the sanitized template, the embedded malicious code can execute, resulting in arbitrary JavaScript execution. This flaw is a CWE‑79 vulnerability due to improper neutralization of input during page generation. This issue is fixed in version 3.4.7.

Affected Systems

The affected product is DOMPurify, managed by the cure53 CNA. All releases older than 3.4.7 are vulnerable, including versions 3.4.6 and earlier. No other vendors or products are listed in the advisory.

Risk and Exploitability

The CVSS score is 6.3, indicating moderate severity. The EPSS score is below 1%, suggesting a low probability of exploitation at this time, and the vulnerability is not listed in the CISA KEV catalog. The likely attack vector requires an attacker to supply malicious markup containing an attached shadow root within a <template> element, rely on an application that performs IN_PLACE sanitization followed by cloning and insertion of the template, and then trigger the embedded code. Because the flaw bypasses sanitization of the shadow root, the contained script or event handlers can execute when the template is rendered.

Generated by OpenCVE AI on July 31, 2026 at 05:05 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade DOMPurify to at least version 3.4.7
  • If upgrading is not immediately possible, avoid cloning or inserting sanitized templates that contain attached shadow roots; instead, strip or detach shadow roots before calling DOMPurify IN_PLACE sanitization
  • As a temporary workaround, manually remove any remaining script tags, event handler attributes, and JavaScript URLs from the sanitized content before it is inserted into the page

Generated by OpenCVE AI on July 31, 2026 at 05:05 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-rp9w-3fw7-7cwq DOMPurify IN_PLACE Sanitization Bypass via Attached Shadow Root Inside <template>.content
History

Tue, 21 Jul 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Wed, 15 Jul 2026 16:00:00 +0000

Type Values Removed Values Added
First Time appeared Cure53
Cure53 dompurify
Vendors & Products Cure53
Cure53 dompurify

Wed, 15 Jul 2026 12:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

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

threat_severity

Important


Tue, 14 Jul 2026 20:30:00 +0000

Type Values Removed Values Added
Description DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Prior to 3.4.7, DOMPurify IN_PLACE sanitization could skip shadow contents attached to an element inside <template>.content, allowing attacker-controlled markup such as event handlers, JavaScript URLs, or scripts to survive and execute when an application cloned and inserted the sanitized template. This issue is fixed in version 3.4.7.
Title DOMPurify IN_PLACE Sanitization Bypass via Attached Shadow Root Inside <template>.content
Weaknesses CWE-79
References
Metrics cvssV4_0

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


Subscriptions

Cure53 Dompurify
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-21T14:59:20.582Z

Reserved: 2026-06-02T18:30:51.281Z

Link: CVE-2026-49978

cve-icon Vulnrichment

Updated: 2026-07-21T14:58:53.763Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Important

Publid Date: 2026-07-14T20:02:46Z

Links: CVE-2026-49978 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T05:15:03Z

Weaknesses
  • CWE-79

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