CVE-2020-5312 PCX P mode buffer overflow in Pillow

Critical 9.8 Published Updated

A buffer overflow in Pillow's PCX 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-5312?

CVE-2020-5312 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/PcxDecode.c in Pillow before 6.2.2 has a PCX P mode buffer overflow.

Weakness: CWE-120

Which versions are affected by CVE-2020-5312?

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
Linux distribution packages (20)
python-imaging Red Hat:enterprise_linux:6::clientAll versions0:1.1.6-20.el6_10
python-imaging-debuginfo Red Hat:enterprise_linux:6::clientAll versions0:1.1.6-20.el6_10
python-imaging-devel Red Hat:enterprise_linux:6::clientAll versions0:1.1.6-20.el6_10
python-imaging-sane Red Hat:enterprise_linux:6::clientAll versions0:1.1.6-20.el6_10
python-imaging-tk Red Hat:enterprise_linux:6::clientAll versions0:1.1.6-20.el6_10
python-imaging Red Hat:enterprise_linux:6::computenodeAll versions0:1.1.6-20.el6_10
python-imaging-debuginfo Red Hat:enterprise_linux:6::computenodeAll versions0:1.1.6-20.el6_10
python-imaging-devel Red Hat:enterprise_linux:6::computenodeAll versions0:1.1.6-20.el6_10
python-imaging-sane Red Hat:enterprise_linux:6::computenodeAll versions0:1.1.6-20.el6_10
python-imaging-tk Red Hat:enterprise_linux:6::computenodeAll versions0:1.1.6-20.el6_10
python-imaging Red Hat:enterprise_linux:6::serverAll versions0:1.1.6-20.el6_10
python-imaging-debuginfo Red Hat:enterprise_linux:6::serverAll versions0:1.1.6-20.el6_10
python-imaging-devel Red Hat:enterprise_linux:6::serverAll versions0:1.1.6-20.el6_10
python-imaging-sane Red Hat:enterprise_linux:6::serverAll versions0:1.1.6-20.el6_10
python-imaging-tk Red Hat:enterprise_linux:6::serverAll versions0:1.1.6-20.el6_10
python-imaging Red Hat:enterprise_linux:6::workstationAll versions0:1.1.6-20.el6_10
python-imaging-debuginfo Red Hat:enterprise_linux:6::workstationAll versions0:1.1.6-20.el6_10
python-imaging-devel Red Hat:enterprise_linux:6::workstationAll versions0:1.1.6-20.el6_10
python-imaging-sane Red Hat:enterprise_linux:6::workstationAll versions0:1.1.6-20.el6_10
python-imaging-tk Red Hat:enterprise_linux:6::workstationAll versions0:1.1.6-20.el6_10

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

How do I fix CVE-2020-5312?

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-5312 being exploited?

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

All Canonical Ubuntu Linux vulnerabilities

Sources

Also known as ALPINE-CVE-2020-5312, BIT-pillow-2020-5312, DEBIAN-CVE-2020-5312, GHSA-p49h-hjvm-jg3h, PYSEC-2020-83, RHSA-2020:0898 and 1 more.

Is CVE-2020-5312 in your software?

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

Check your SBOMs for free