GitHub Advisoryadvisory · npm
GHSA-chqj-j4fh-rw7m Cross-Site Scripting in dompurify
MEDIUM
Official page ↗
- Aliases
- CVE-2019-16728
- Ecosystem
- npm
- Packages
- dompurify
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Weaknesses
- CWE-79
- Reviewed
- 2020-08-28
Affected packages
• npm dompurify: < 2.0.3 → fixed in 2.0.3
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 ``/`` elements and ``/``. An example payload is: `">`. 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 `` and `` through `dompurify` configurations:
```DOMPurify.sanitize(input, {
FORBID_TAGS: ['svg', 'math']
});```
Related
Alias · CVE (1)
- CVE-2019-16728 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… vulnerability
Weakness · CWE (1)
- CWE-79 Improper Neutralization of Input During Web Page Generation weakness