# CVE-2020-6816: Bleach vulnerable to mutation XSS via whitelisted math or svg and raw tag

Source: https://junglewise.ai/threats/cve-2020-6816-bleach-vulnerable-to-mutation-xss-via-whitelisted-math-or-svg-and  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2020-03-24  
License: CC BY 4.0 with a link back

CVE-2020-6816 · Severity: low · CVSS 3.1 · Published 2020-03-24

In Mozilla Bleach before 3.12, a mutation XSS in bleach.clean when RCDATA and either svg or math tags are whitelisted and the keyword argument strip=False.

Technologies: [bleach (PyPI)](https://junglewise.ai/threats/technologies/bleach). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2020-6816 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2020-6816 being exploited in the wild.

**How severe is CVE-2020-6816?** Low severity, with a CVSS score of 3.1, published 24 March 2020.

**Which products and versions are affected?** bleach (PyPI) ECOSYSTEM:introduced=0,fixed=3.1.2.

**Is there a fix for CVE-2020-6816?** Yes. bleach (PyPI): upgrade to 3.1.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2020-6816?** Check whether you run bleach (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- bleach (PyPI): upgrade to 3.1.2 or later

  ```sh
  pip install "bleach>=3.1.2"
  ```


## Affected products

- bleach (PyPI) ECOSYSTEM:introduced=0,fixed=3.1.2

## Identifiers

- CVE-2020-6816
- GHSA-m6xf-fq7q-8743
- PYSEC-2020-28

## Related threats

- [Mozilla Bleach XSS via unsanitized formaction attribute](https://junglewise.ai/threats/mozilla-bleach-xss-via-unsanitized-formaction-attribute-604755fa)
- [Mozilla Bleach ReDoS in linkify with parse_email enabled](https://junglewise.ai/threats/mozilla-bleach-redos-in-linkify-with-parse-email-enabled-47729578)
- [Mozilla Bleach URI sanitization bypass via Unicode characters](https://junglewise.ai/threats/mozilla-bleach-uri-sanitization-bypass-via-unicode-characters-79149728)
- [Cross-site scripting in Bleach](https://junglewise.ai/threats/cve-2021-23980-cross-site-scripting-in-bleach)
- [regular expression denial-of-service (ReDoS) in Bleach](https://junglewise.ai/threats/cve-2020-6817-regular-expression-denial-of-service-redos-in-bleach)
