DOMPurify before 3.4.9 Trusted Types Policy State Contamination
cure53 DOMPurify
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| dompurify npm |
|
|
Original 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.
From the CVE record · VulnCheck