CVE-2016-3076: Heap-based buffer overflow in Pillow
Summary
CVE-2016-3076: Heap-based buffer overflow in the j2k_encode_entry function in Pillow 2.5.0 through 3.1.1 allows remote attackers to cause a denial of service (memory corruption) via a crafted Jpeg2000 file. Affects pillow versions >= 2.5.0, < 3.1.2. Fixed in 3.1.2. How to fix ↓
Also tracked for
- pillow · Debian:11
The same CVE-2016-3076 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 tasks. However, versions 2.5.0 through 3.1.1 of Pillow are vulnerable to a heap-based buffer overflow.
Vulnerability Detail
The vulnerability, identified as CVE-2016-3076, resides in the j2k_encode_entry function of Pillow. It can be exploited by remote attackers through a crafted Jpeg2000 file. By exploiting this vulnerability, an attacker can cause a denial of service (memory corruption) on the targeted system. The heap-based buffer overflow occurs due to improper handling of certain input data, leading to memory corruption and potential system instability.
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
3.1.2
This is the first release that contains the fix.
pip install --upgrade "pillow==3.1.2"
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 essential to apply the recommended fix by updating Pillow to the latest secure version.
Conclusion
In conclusion, the vulnerability identified as CVE-2016-3076 in Pillow versions 2.5.0 through 3.1.1 poses a risk of heap-based buffer overflow. It can be exploited remotely through a crafted Jpeg2000 file, leading to memory corruption and potential denial of service. To mitigate this vulnerability, it is crucial to update Pillow to version 3.1.2 or later. For further assistance or support in 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.
A heap-based buffer overflow is a type of vulnerability where an attacker can overwrite data in the heap memory, potentially leading to memory corruption and system instability.
This vulnerability can be exploited by remote attackers through a specially crafted Jpeg2000 file, causing a denial of service by corrupting the memory.
The potential consequences of this vulnerability include system instability, crashes, and potential for remote code execution if combined with other vulnerabilities.
Yes, a fix is available for this vulnerability. Users are advised to update Pillow to version 3.1.2 or later to mitigate the risk.
Related vulnerabilities
Recent vulnerabilities recorded for pillow.