CVE-2021-25291 Out of bounds read in Pillow

High 7.5 Published Updated

An out-of-bounds read in Pillow's TIFF decoder allows attackers to cause denial of service or disclose sensitive memory contents via crafted images.

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

What is CVE-2021-25291?

CVE-2021-25291 is a high-severity memory corruption vulnerability in Python Pillow, published on 19 Mar 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

An issue was discovered in Pillow before 8.1.1. In TiffDecode.c, there is an out-of-bounds read in TiffreadRGBATile via invalid tile boundaries.

Weakness: CWE-125

Which versions are affected by CVE-2021-25291?

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 PyPIAll versions8.2.0
pillow PyPIAll versions8.2.0

Products include Python Pillow.

How do I fix CVE-2021-25291?

Upgrade pillow to a fixed version for your release line: 8.1.1 or 8.2.0.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2021-25291 being exploited?

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

All Python Pillow vulnerabilities

Sources

Also known as ALPINE-CVE-2021-25291, BIT-pillow-2021-25291, DEBIAN-CVE-2021-25291, GHSA-mvg9-xffr-p774, PYSEC-2021-37, UBUNTU-CVE-2021-25291.

Is CVE-2021-25291 in your software?

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

Check your SBOMs for free