CVE-2026-112898: Pillow Image.quantize() Stack Memory Leak Vulnerability

pillow Updated 21 Oct 2026

Summary

21/10/2026
Yes i
Moderate
6.9

CVE-2026-112898: Pillow: Image.quantize() with empty palette leaks uninitialized stack memory. Affects pillow versions >= 9.1.0, < 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 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 widely-used Python Imaging Library that provides extensive capabilities for opening, manipulating, and saving various image file formats. It supports operations such as image filtering, transformation, and color management. However, a vulnerability has been identified in the Image.quantize() function, which allows users to supply a palette image. This vulnerability can lead to uninitialized stack memory being leaked, posing a security risk to applications using Pillow.

Vulnerability Detail

The vulnerability arises from the Image.quantize() function when an empty palette is provided. Specifically, in the ImagingPaletteCacheUpdate() function, a local array intended to store color indices is not initialized when the palette size is zero. As a result, the function inadvertently returns uninitialized stack memory as pixel values. This can lead to the disclosure of sensitive information, including memory addresses and stack canary values, without causing a crash or generating log entries. The issue was introduced in commit 54cb09d8b48c and affects versions starting from 9.1.0.

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 an empty palette with the Image.quantize() function. Ensure that the palette provided has at least one entry to prevent the exposure of uninitialized memory.

Conclusion

The CVE-2026-112898 vulnerability in the Pillow library poses a significant risk by allowing uninitialized stack memory to be leaked through the Image.quantize() function when an empty palette is used. It is crucial to update to the patched version 13.0.0 or later to mitigate this risk and ensure the security of applications utilizing Pillow.

See every vulnerability recorded for pillow →

Share this vulnerability

FAQ

CVE-2026-112898 is a vulnerability in the Pillow library that allows uninitialized stack memory to be leaked when using the Image.quantize() function with an empty palette.

If your application allows users to supply a palette image for quantization, it may inadvertently expose sensitive information from the server's memory, including memory addresses and canary values.

The vulnerability affects Pillow versions starting from 9.1.0 up to but not including 13.0.0.

You can use Vulert, a tool that monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score for this vulnerability is 6.9, indicating a moderate severity level.

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"

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