CVE-2020-35653: Pillow PCXDecode Buffer Over-read Vulnerability
Summary
CVE-2020-35653: In Pillow before 8.1.0, PcxDecode has a buffer over-read when decoding a crafted PCX file because the user-supplied stride value is trusted for buffer calculations. Affects pillow versions < 8.1.0. Fixed in 8.1.0. How to fix ↓
Also tracked for
- pillow · Bitnami
- py3-pillow · Alpine:v3.14
The same CVE-2020-35653 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Pillow is a popular Python imaging library that provides support for opening, manipulating, and saving many different image file formats. It is widely used in various applications for image processing and manipulation. The vulnerability in question affects versions of Pillow prior to 8.1.0 and specifically impacts the PCXDecode function. PCX is a raster image file format that was commonly used in the early days of personal computing. The vulnerability arises due to a buffer over-read when decoding a crafted PCX file. This occurs because the user-supplied stride value is trusted for buffer calculations.
Vulnerability Detail
The vulnerability allows an attacker to exploit the buffer over-read issue in the PCXDecode function of Pillow. By providing a specially crafted PCX file, an attacker can trigger the buffer over-read, potentially leading to information disclosure or a denial of service. The buffer over-read occurs due to the incorrect handling of the stride value, which is used for buffer calculations. If an attacker can trick a user or application into opening a malicious PCX file using a vulnerable version of Pillow, they can exploit this vulnerability.
How To Fix
Latest published version: 13.0.0 as of 22 Oct 2026
pip install --upgrade "pillow==13.0.0"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
8.1.0
This is the first release that contains the fix.
pip install --upgrade "pillow==8.1.0"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is strongly advised to update to the latest version of Pillow to mitigate the risk.
Conclusion
The vulnerability in Pillow's PCXDecode function can be exploited by providing a specially crafted PCX file, leading to a buffer over-read. To mitigate the risk, users and developers should update to version 8.1.0 or later of Pillow. There is no known workaround for this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for pillow →
FAQ
Pillow is a Python imaging library that provides support for opening, manipulating, and saving various image file formats.
PCXDecode is a function in Pillow that handles the decoding of PCX image files.
A buffer over-read occurs when a program reads data from a buffer beyond its intended boundaries. In this case, the buffer over-read happens due to the incorrect handling of the stride value in the PCXDecode function.
The vulnerability could potentially lead to information disclosure or a denial of service if an attacker can exploit the buffer over-read issue. This could result in the exposure of sensitive data or the crashing of the application using the vulnerable version of Pillow.
To protect your application, it is recommended to update to the latest version of Pillow (8.1.0 or later) that includes a fix for this vulnerability. Regularly updating your dependencies and staying informed about security vulnerabilities is crucial for maintaining the security of your application.
References
Related vulnerabilities
Recent vulnerabilities recorded for pillow.