CVE-2020-6817 regular expression denial-of-service (ReDoS) in Bleach

High 7.5 Published Updated

Attackers can cause denial of service in applications using Bleach by exploiting ReDoS in style attribute parsing when specific tags and styles are allowed.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2020-6817?

CVE-2020-6817 is a high-severity denial of service vulnerability in Mozilla Bleach, published on 16 Feb 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS). Calls to bleach.clean with an allowed tag with an allowed style attribute are vulnerable to ReDoS. For example, bleach.clean(..., attributes={'a': ['style']}).

Weakness: CWE-1333

Which versions are affected by CVE-2020-6817?

3 open source packages ship an affected version, including bleach. It affects 1 product.

PackageAffectedFixed in
bleach PyPIAll versions3.1.4
bleach PyPIAll versions3.1.4
bleach PyPIAll versions3.1.4

Products include Mozilla Bleach.

How do I fix CVE-2020-6817?

Upgrade bleach to 3.1.4 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2020-6817 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2020-6817 exists.

Sources

Also known as DEBIAN-CVE-2020-6817, DLA-2167-1, GHSA-vqhp-cxgc-6wmm, PYSEC-2020-340, SNYK-PYTHON-BLEACH-561754, UBUNTU-CVE-2020-6817.

Is CVE-2020-6817 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free