CVE-2021-25292 Regular Expression Denial of Service (ReDoS) in Pillow

Medium 6.5 Published Updated

Attackers can cause a denial of service in Pillow via crafted PDF files triggering catastrophic regex backtracking.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-25292?

CVE-2021-25292 is a medium-severity denial of service vulnerability in Python Pillow, published on 19 Mar 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

An issue was discovered in Pillow before 8.1.1. The PDF parser allows a regular expression DoS (ReDoS) attack via a crafted PDF file because of a catastrophic backtracking regex.

Weakness: CWE-1333

Which versions are affected by CVE-2021-25292?

4 open source packages ship an affected version, including pillow. It affects 1 product.

PackageAffectedFixed in
pillow BitnamiAll versions8.1.1
pillow PyPIAll versions8.1.1
pillow PyPIFrom 5.1.08.1.1
pillow PyPIFrom 5.1.08.1.1

Products include Python Pillow.

How do I fix CVE-2021-25292?

Upgrade pillow to 8.1.1 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-2021-25292 being exploited?

There is no known exploitation of CVE-2021-25292 in the wild and no public exploit code.

All Python Pillow vulnerabilities

Sources

Also known as ALPINE-CVE-2021-25292, BIT-pillow-2021-25292, DEBIAN-CVE-2021-25292, GHSA-9hx2-hgq2-2g4f, PYSEC-2021-38, UBUNTU-CVE-2021-25292.

Is CVE-2021-25292 in your software?

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

Check your SBOMs for free