Critical Code Execution Vulnerability in Pillow Package

pillow Updated 02 Oct 2025

Summary

04/11/2016
N/A
Yes i
High
7.8

CVE-2016-9190: Pillow before 3.3.2 allows context-dependent attackers to execute arbitrary code by using the "crafted image file" approach, related to an "Insecure Sign Extension" issue affecting the ImagingNew in Storage.c component. Affects pillow across 2 version ranges.

< 3.4.2-1 < aab33141f381d5577cdef9033b7fdff79122a10c

Fixed in 3.4.2-1. How to fix ↓

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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Pillow is a widely used Python Imaging Library that adds image processing capabilities to your Python interpreter. It supports opening, manipulating, and saving many different image file formats. Despite its robust functionality, Pillow has been found vulnerable to a specific issue that allows context-dependent attackers to execute arbitrary code through crafted image files.

Vulnerability Detail

The vulnerability, identified as CVE-2016-9190, arises from an 'Insecure Sign Extension' issue in the ImagingNew function within the Storage.c component of Pillow. This flaw allows attackers to exploit the library by providing specially crafted image files, leading to potential arbitrary code execution. The implications of this vulnerability are severe, as it can compromise the integrity and security of applications relying on Pillow for image processing.

How To Fix

Minimum fixed version

3.4.2-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade pillow

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading is not immediately feasible, consider validating and sanitizing all image inputs before processing them with Pillow. This can help mitigate the risk of exploitation by ensuring that only safe and expected image formats are processed.

Conclusion

The CVE-2016-9190 vulnerability in the Pillow package poses a significant risk of arbitrary code execution through crafted image files. It is crucial for developers using Pillow to upgrade to the latest version to mitigate this risk. Additionally, utilizing tools like Vulert can help monitor for such vulnerabilities in real-time.

See every vulnerability recorded for pillow →

Share this vulnerability

FAQ

CVE-2016-9190 is a vulnerability in the Pillow package that allows attackers to execute arbitrary code through specially crafted image files.

You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without any signup.

Exploitation of this vulnerability can lead to arbitrary code execution, potentially compromising the security and integrity of the application using Pillow.

Yes, upgrading to Pillow version 3.4.2-1 or later resolves the vulnerability.

As a temporary measure, validate and sanitize all image inputs before processing them to reduce the risk of exploitation.

Related vulnerabilities

Recent vulnerabilities recorded for pillow.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

3.4.2-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade pillow

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