REDHAT-BUG-2506434: Medium severity Cure53 DOMPurify vulnerability
In DOMPurify through 3.3.3, function predicates supplied via ADDATTR or ADDTAGS to DOMPurify.sanitize() persist in internal state (EXTRAELEMENTHANDLING) across subsequent sanitize() calls on the same instance. If a later call on the same instance provides ADDATTR or ADDTAGS as an array rather than a function, the previously set function handler is neither cleared nor overwritten, so it continues to approve attacker-controlled attributes or tags. This can allow dangerous event-handler attributes or forbidden tags (bypassing FORBIDTAGS) to survive sanitization, resulting in cross-site scripting. The vendor (Cure53) considers this an edge case outside DOMPurify's threat model; the referenced advisory lists 3.4.0 as the patched version.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
DOMPurifyto a version that resolves this vulnerability.Fixed in 3.4.0
Event History
Frequently Asked Questions
Which application patterns are exposed to this issue?
Applications are exposed when they reuse the same DOMPurify instance across sanitize() calls, first supplying a function predicate through ADD_ATTR or ADD_TAGS and later supplying ADD_ATTR or ADD_TAGS as an array. In that sequence, the earlier function can remain active.
What can an attacker gain from the stale handler?
The retained predicate may continue approving attacker-controlled attributes or tags. This can preserve dangerous event-handler attributes or tags otherwise blocked by FORBID_TAGS, leading to cross-site scripting.
What version is identified as patched?
The referenced advisory identifies DOMPurify 3.4.0 as the patched version. The issue affects DOMPurify through 3.3.3.
How does the vendor characterize this issue?
Cure53 considers it an edge case outside DOMPurify's threat model.