REDHAT-BUG-2517772: Medium severity DOMPurify DOMPurify vulnerability
DOMPurify before 3.4.13 contains a cross-site scripting vulnerability in INPLACE sanitization where element-removal hooks fail to neutralize detached subtrees. Attackers can supply HTML with event handlers on descendant elements that execute after sanitization completes, even though the returned root appears clean.
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.13
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using DOMPurify versions before 3.4.13 are exposed when they use IN_PLACE sanitization together with element-removal hooks. The risk applies when an attacker can supply HTML that is passed through that sanitization path.
What must an attacker provide to exploit the vulnerability?
An attacker must be able to supply crafted HTML containing event handlers on descendant elements. The exploit relies on detached subtrees whose handlers are not neutralized by element-removal hooks during IN_PLACE sanitization.
How can I determine whether my use of DOMPurify is affected?
Check whether the deployed DOMPurify version is earlier than 3.4.13, and review sanitization code for use of IN_PLACE mode and element-removal hooks. A clean-looking returned root does not rule out exposure if removed detached subtrees can retain descendant event handlers.