CVE-2019-16728: XSS
DOMPurify before 2.0.1 allows XSS because of innerHTML mutation XSS (mXSS) for an SVG element or a MATH element, as demonstrated by Chrome and Safari.
Other sources
DOMPurify is vulnerable to cross-site scripting, caused by improper validation of user-supplied input. A remote attacker could exploit this vulnerability using an SVG element or a MATH element into a Web page which would be executed in a victim's Web browser within the security context of the hosting Web site, once the page is viewed. An attacker could use this vulnerability to steal the victim's cookie-based authentication credentials.
— IBM
Versions of dompurify prior to 2.0.3 are vulnerable to Cross-Site Scripting (XSS). The package has an XSS filter bypass due to Mutation XSS in both Chrome and Safari through a combination of <svg>/<math> elements and </p>/</br>. An example payload is: <svg></p><style><a id="</style><img src=1 onerror=alert(1)>">. This allows attackers to bypass the XSS protection and execute arbitrary JavaScript in a victim's browser.
Recommendation
Upgrade to version 2.0.3 or later. You may also disallow <svg> and <math> through dompurify configurations: DOMPurify.sanitize(input, { FORBIDTAGS: ['svg', 'math'] });
Affected Software
Event History
Frequently Asked Questions
What is the vulnerability ID for this issue?
The vulnerability ID is CVE-2019-16728.
What is the severity level of CVE-2019-16728?
The severity of CVE-2019-16728 is medium (6.1).
What is the affected software for CVE-2019-16728?
The affected software for CVE-2019-16728 includes versions of `dompurify` prior to 2.0.3 and IBM Security Verify Privilege On-Premises (all versions).
How does the vulnerability in CVE-2019-16728 occur?
The vulnerability in CVE-2019-16728 occurs due to an XSS filter bypass in `dompurify` caused by improper validation of user-supplied input.
How can I fix the vulnerability in CVE-2019-16728?
To fix the vulnerability in CVE-2019-16728, upgrade to version 2.0.3 or later of `dompurify` or apply the necessary security patches provided by the software vendor.