CVE-2019-16728
MEDIUM6.1EPSS 0.96%Cross-Site Scripting in dompurify
Published: 8/28/2020Modified: 11/8/2023
Also known as:GHSA-chqj-j4fh-rw7m
Description
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, { FORBID_TAGS: ['svg', 'math'] });```
Affected packages (2)
- Debian/dompurify.jsfrom 0, < 0.8.2~dfsg1-1+deb9u1
- npm/dompurifyfrom 0, < 2.0.3
CVSS scores
| Source | Version | Severity | Vector |
|---|---|---|---|
| osv | CVSS 3.1 | MEDIUM6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |