CVE-2020-5311 Buffer Copy without Checking Size of Input in Pillow

Critical 9.8 Published Updated

A buffer overflow in Pillow's SGI decoder allows attackers to execute arbitrary code or cause denial of service 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-2020-5311?

CVE-2020-5311 is a critical memory corruption vulnerability in Canonical Ubuntu Linux, published on 3 Jan 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

libImaging/SgiRleDecode.c in Pillow before 6.2.2 has an SGI buffer overflow.

Weakness: CWE-120

Which versions are affected by CVE-2020-5311?

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

PackageAffectedFixed in
pillow BitnamiAll versions6.2.2
pillow PyPIAll versions6.2.2
pillow PyPIAll versions6.2.2
pillow PyPIAll versions6.2.2

Products include Canonical Ubuntu Linux, Debian Debian Linux, Fedoraproject Fedora, Python Pillow.

How do I fix CVE-2020-5311?

Upgrade pillow to 6.2.2 or later.

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

Is CVE-2020-5311 being exploited?

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

All Canonical Ubuntu Linux vulnerabilities

Sources

Also known as ALPINE-CVE-2020-5311, BIT-pillow-2020-5311, DEBIAN-CVE-2020-5311, GHSA-r7rm-8j6h-r933, PYSEC-2020-82, UBUNTU-CVE-2020-5311.

Is CVE-2020-5311 in your software?

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

Check your SBOMs for free