Description
DOMPurify 3.0.0 before 3.4.9 does not reset the retained Trusted Types policy when clearConfig() is called, so a DOMPurify instance reused across trust boundaries stays bound to a previously supplied TRUSTED_TYPES_POLICY. A later caller that requests RETURN_TRUSTED_TYPE output receives a TrustedHTML object created by the old (potentially unsafe) policy rather than a clean default, which can lead to script execution at a Trusted Types sink. Passing TRUSTED_TYPES_POLICY: null on the later call also does not clear the retained policy.
Published: 2026-07-23
Score: 5.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

DOMPurify versions before 3.4.9 do not reset the retained Trusted Types policy when clearConfig() is called; a reused DOMPurify instance across trust boundaries remains bound to a previously supplied TRUSTED_TYPES_POLICY. Based on the description, it is inferred that an attacker who can supply a custom Trusted Types policy before clearConfig() is invoked—while the same DOMPurify instance remains active—can later request RETURN_TRUSTED_TYPE and receive a TrustedHTML object crafted with the older, potentially unsafe policy. When a later caller requests RETURN_TRUSTED_TYPE output, the library returns a TrustedHTML object that is created by the older, potentially unsafe policy instead of a clean default, which can lead to script execution at a Trusted Types sink. This flaw can therefore allow an attacker to inject executable HTML content that bypasses XSS defenses provided by Trusted Types.

Affected Systems

The vulnerability affects the DOMPurify client‑side library distributed by cure53. All releases from 3.0.0 up to (but excluding) 3.4.9 are impacted. Applications that instantiate a DOMPurify object and reuse the same instance across different trust contexts are susceptible.

Risk and Exploitability

Based on the description, it is inferred that the attacker must be able to influence or supply a Trusted Types policy to a reused DOMPurify instance, then later trigger a Trusted Types sink after clearConfig() does not reset the policy. The likely attack vector is the manipulation of the Trusted Types policy provided to a DOMPurify instance that is reused across trust boundaries. The CVSS score of 5.1 indicates medium severity while the EPSS score of < 1% suggests a low likelihood of exploitation in the near term. The issue is not listed in the CISA Known Exploited Vulnerabilities catalog, so no active exploits have been reported. In environments that heavily rely on Trusted Types for XSS mitigation, the potential impact is higher, but the absence of documented exploits and the low EPSS value reduce the overall risk assessment for most organizations.

Generated by OpenCVE AI on August 3, 2026 at 21:33 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to DOMPurify version 3.4.9 or newer, which implements proper Trusted Types policy reset during clearConfig.
  • If an upgrade is not immediately possible, instantiate a fresh DOMPurify object whenever the code crosses a trusted boundary and avoid reusing the same instance across contexts.
  • Review the application to ensure clearConfig is invoked with a new configuration object when reinitialization is required and that no residual policy remains bound to the instance.

Generated by OpenCVE AI on August 3, 2026 at 21:33 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-vxr8-fq34-vvx9 DOMPurify: Trusted Types policy survives `clearConfig()` and can poison later `RETURN_TRUSTED_TYPE` output
History

Mon, 27 Jul 2026 17:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Thu, 23 Jul 2026 13:30:00 +0000

Type Values Removed Values Added
Description DOMPurify 3.0.0 before 3.4.9 does not reset the retained Trusted Types policy when clearConfig() is called, so a DOMPurify instance reused across trust boundaries stays bound to a previously supplied TRUSTED_TYPES_POLICY. A later caller that requests RETURN_TRUSTED_TYPE output receives a TrustedHTML object created by the old (potentially unsafe) policy rather than a clean default, which can lead to script execution at a Trusted Types sink. Passing TRUSTED_TYPES_POLICY: null on the later call also does not clear the retained policy.
Title DOMPurify before 3.4.9 Trusted Types Policy State Contamination
First Time appeared Cure53
Cure53 dompurify
Weaknesses CWE-693
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'}


Subscriptions

Cure53 Dompurify
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-27T16:20:48.288Z

Reserved: 2026-07-23T11:03:13.092Z

Link: CVE-2026-65899

cve-icon Vulnrichment

Updated: 2026-07-27T16:15:30.360Z

cve-icon NVD

Status : Analyzed

Published: 2026-07-23T14:18:04.683

Modified: 2026-07-28T15:53:23.400

Link: CVE-2026-65899

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T21:45:03Z

Weaknesses
  • CWE-693

    Protection Mechanism Failure