GHSA-chqj-j4fh-rw7m

Suggest an improvement
Source
https://github.com/advisories/GHSA-chqj-j4fh-rw7m
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/08/GHSA-chqj-j4fh-rw7m/GHSA-chqj-j4fh-rw7m.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-chqj-j4fh-rw7m
Aliases
Published
2020-08-28T21:25:11Z
Modified
2023-11-08T04:01:20.360896Z
Severity
  • 6.1 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N CVSS Calculator
Summary
Cross-Site Scripting in dompurify
Details

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'] });

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-79"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2020-08-28T21:24:05Z"
}
References

Affected packages

npm / dompurify

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.0.3