CVE-2026-112898 Pillow: Image.quantize() with empty palette leaks uninitialized stack memory
An attacker can leak uninitialized stack memory, including addresses and canaries, by providing an empty palette to Image.quantize() in Pillow.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-112898?
CVE-2026-112898 is a medium-severity vulnerability in Python Pillow, published on 19 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Pillow is a Python imaging library. From 9.1.0 until 13.0.0, Pillow can disclose uninitialized stack memory when Image.quantize() uses an empty palette. ImagingPaletteCacheUpdate() leaves a local cache array uninitialized when the palette has zero entries, and the conversion path emits those bytes as output pixel indices. An attacker who controls the palette image can obtain stack contents from a returned PNG or GIF. This can disclose addresses and stack-canary data without an out-of-bounds access, memory corruption, or process crash. This issue is fixed in version 13.0.0.
Weakness: CWE-457
Which versions are affected by CVE-2026-112898?
3 open source packages ship an affected version, including pillow and Pillow. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pillow Bitnami | From 9.1.0 | 13.0.0 |
pillow PyPI | From 9.1.0 | 13.0.0 |
Pillow PyPI | From 9.1.0 | 13.0.0 |
Products include Python Pillow.
How do I fix CVE-2026-112898?
Upgrade pillow to 13.0.0 or later.
Is CVE-2026-112898 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-112898 exists.
Other vulnerabilities in Python Pillow
Sources
Also known as BIT-pillow-2026-112898, DEBIAN-CVE-2026-112898, ECHO-40ef-e643-dc9f, GHSA-rfgq-q3w2-pmv2, UBUNTU-CVE-2026-112898.