CVE-2026-112403: Pillow Heap Buffer Overflow in ImagingJpegDecode

pillow Updated 20 Oct 2026

Summary

20/10/2026
Yes i
Critical
9.2

CVE-2026-112403: Pillow: Heap buffer overflow in ImagingJpegDecode. Affects pillow versions < 13.0.0. Fixed in 13.0.0. 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. This library is essential for developers working with images in Python applications. However, a critical vulnerability has been identified in its JPEG decoding functionality, specifically in the handling of lossless JPEG images, which can lead to severe security risks.

Vulnerability Detail

The vulnerability arises from a heap buffer overflow in the ImagingJpegDecode function of the Pillow library. When the draft method is called, it improperly allocates a buffer for decoded JPEG scanlines without validating the dimensions of the image against the allocated buffer size. This oversight allows an attacker to craft a specially formatted JPEG image that, when processed, can lead to memory corruption and potentially execute arbitrary code. The vulnerability is particularly dangerous as it can be triggered by standard-compliant JPEG files, making it difficult to mitigate through input validation alone.

How To Fix

Latest published version: 13.0.0 as of 22 Oct 2026

pip install --upgrade "pillow==13.0.0"

The newest release already contains this fix.

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

Workaround

As a temporary workaround, avoid using the Image.thumbnail() method on JPEG images that may be encoded in lossless format. Instead, consider using other methods such as Image.resize() or loading the image with Image.open() followed by im.load() before any thumbnail operations.

Conclusion

The CVE-2026-112403 vulnerability in the Pillow library poses a significant risk due to a heap buffer overflow in its JPEG decoding functionality. It is crucial for developers to update to the latest version of Pillow to protect their applications from potential exploitation. By following the recommended steps and utilizing available resources like Vulert, developers can ensure their software remains secure.

See every vulnerability recorded for pillow →

Share this vulnerability

FAQ

CVE-2026-112403 is a critical vulnerability in the Pillow library that allows for a heap buffer overflow when processing certain JPEG images.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which monitors and alerts for open-source vulnerabilities in real-time.

Exploiting this vulnerability can lead to memory corruption, arbitrary code execution, and potentially compromise the security of the application using the Pillow library.

Yes, a patch is available in Pillow version 13.0.0 and later. It is recommended to upgrade to this version to mitigate the vulnerability.

If you cannot upgrade immediately, avoid using the Image.thumbnail() method on potentially vulnerable JPEG images as a temporary workaround.

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

Latest published version: 13.0.0 as of 22 Oct 2026

pip install --upgrade "pillow==13.0.0"

The newest release already contains this fix.

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