CVE-2021-25289 Out of bounds write in Pillow

Critical 9.8 Published Updated

Heap-based buffer overflow in Pillow's TiffDecode allows attackers to execute arbitrary code or cause denial of service via crafted YCbCr files.

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-25289?

CVE-2021-25289 is a critical 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. TiffDecode has a heap-based buffer overflow when decoding crafted YCbCr files because of certain interpretation conflicts with LibTIFF in RGBA mode. NOTE: this issue exists because of an incomplete fix for CVE-2020-35654.

Weakness: CWE-787

Which versions are affected by CVE-2021-25289?

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

Products include Python Pillow.

How do I fix CVE-2021-25289?

Upgrade pillow to 8.1.1 or later.

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

Is CVE-2021-25289 being exploited?

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

All Python Pillow vulnerabilities

Sources

Also known as ALPINE-CVE-2021-25289, BIT-pillow-2021-25289, DEBIAN-CVE-2021-25289, GHSA-57h3-9rgr-c24m, PYSEC-2021-35, UBUNTU-CVE-2021-25289.

Is CVE-2021-25289 in your software?

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

Check your SBOMs for free