CVE-2020-5312: Buffer Overflow

Published Jan 3, 2020
·
Updated

A flaw was discovered in python-pillow does where it does not properly restrict operations within the bounds of a memory buffer when decoding PCX images. An application that uses python-pillow to decode untrusted images may be vulnerable to this flaw, which can allow an attacker to crash the application or potentially execute code on the system.

Other sources

libImaging/PcxDecode.c in Pillow before 6.2.2 has a PCX P mode buffer overflow.

libImaging/PcxDecode.c in Pillow before 6.2.2 has an PCX P mode buffer overflow.

Upstream patch:

https://github.com/python-pillow/Pillow/commit/93b22b846e0269ee9594ff71a72bec02d2bea8fd

References:

https://pillow.readthedocs.io/en/stable/releasenotes/6.2.2.html

Red Hat

Affected Software

16 affected componentsFixes available
redhat/python-imaging<0:1.1.6-20.el6_10
0:1.1.6-20.el6_10
redhat/python-pillow<0:2.0.0-20.gitd1c6db8.el7_7
0:2.0.0-20.gitd1c6db8.el7_7
redhat/python-pillow<0:5.1.1-10.el8_1
0:5.1.1-10.el8_1
redhat/python-pillow<0:5.1.1-10.el8_0
0:5.1.1-10.el8_0
redhat/python-pillow<6.2.2
6.2.2
pip/Pillow<6.2.2
6.2.2
Python Pillow<6.2.2
Canonical Ubuntu Linux=14.04
Canonical Ubuntu Linux=16.04
Canonical Ubuntu Linux=18.04
Canonical Ubuntu Linux=19.10
Debian Debian Linux=9.0
Debian Debian Linux=10.0
Fedoraproject Fedora=30
Fedoraproject Fedora=31
debian/pillow
8.1.2+dfsg-0.3+deb11u28.1.2+dfsg-0.3+deb11u39.4.0-1.1+deb12u111.1.0-5+deb13u411.1.0-5+deb13u312.2.0-112.3.0-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/python-imaging to a version that resolves this vulnerability.

    Fixed in 0:1.1.6-20.el6_10
  2. Upgrade

    Upgrade redhat/python-pillow to a version that resolves this vulnerability.

    Fixed in 0:2.0.0-20.gitd1c6db8.el7_7
  3. Upgrade

    Upgrade redhat/python-pillow to a version that resolves this vulnerability.

    Fixed in 0:5.1.1-10.el8_1
  4. Upgrade

    Upgrade redhat/python-pillow to a version that resolves this vulnerability.

    Fixed in 0:5.1.1-10.el8_0
  5. Upgrade

    Upgrade redhat/python-pillow to a version that resolves this vulnerability.

    Fixed in 6.2.2
  6. Upgrade

    Upgrade pip/Pillow to a version that resolves this vulnerability.

    Fixed in 6.2.2
  7. Upgrade

    Upgrade debian/pillow to a version that resolves this vulnerability.

    Fixed in 8.1.2+dfsg-0.3+deb11u2Fixed in 8.1.2+dfsg-0.3+deb11u3Fixed in 9.4.0-1.1+deb12u1Fixed in 11.1.0-5+deb13u4Fixed in 11.1.0-5+deb13u3Fixed in 12.2.0-1Fixed in 12.3.0-1
  8. Upgrade

    Upgrade python-pillow/Pillow to a version that resolves this vulnerability.

    Fixed in 6.2.2Patch 93b22b846e0269ee9594ff71a72bec02d2bea8fd

Event History

Jan 3, 2020
CVE Published
12:00 AM
CVE Published
via MITRE·12:52 AM
Data Sourced
via MITRE·12:52 AM
Description
Data Sourced
via NVD·01:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Nov 3, 2021
Advisory Published
via GitHub·06:05 PM
Feb 21, 2026
Data Sourced
via Ubuntu·12:01 AM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Launchpad·12:02 AM
Description
Jul 20, 2026
Data Sourced
via Debian·11:41 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is CVE-2020-5312?

CVE-2020-5312 is a vulnerability in libImaging/PcxDecode.c in Pillow before 6.2.2 that allows a PCX P mode buffer overflow.

2

What is the severity of CVE-2020-5312?

The severity of CVE-2020-5312 is critical with a severity score of 9.8.

3

How does CVE-2020-5312 affect python-pillow?

CVE-2020-5312 affects python-pillow versions before 6.2.2.

4

How can I fix the vulnerability CVE-2020-5312?

To fix the vulnerability CVE-2020-5312, update python-pillow to version 6.2.2 or later.

5

Where can I find more information about CVE-2020-5312?

You can find more information about CVE-2020-5312 in the references provided: [link1](https://github.com/python-pillow/Pillow/commit/93b22b846e0269ee9594ff71a72bec02d2bea8fd), [link2](https://pillow.readthedocs.io/en/stable/releasenotes/6.2.2.html), [link3](https://bugzilla.redhat.com/show_bug.cgi/show_bug.cgi?id=1789541).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203