CVE-2016-3076: Heap-based buffer overflow in Pillow

pillow Updated 02 Oct 2025

Summary

24/04/2017
Yes i
High
5.5

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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback