What’s Vulnerable › Vulnerabilities
CVE-2026-112898: Pillow: Image.quantize() with empty palette leaks uninitialized stack memory
- Severity: medium (CVSS 5.3 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.4% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2026-10-19 · updated 2026-10-28
- Weakness: CWE-457
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.
Affected products
- python-pillow Pillow: from 9.1.0 before 13.0.0 — fixed in 13.0.0
- python-pillow Pillow: from 9.1.0, < 13.0.0
How to fix
Upgrade to a fixed version: python-pillow Pillow 13.0.0. Check the vendor advisory for mitigations.
References
- https://github.com/python-pillow/Pillow/commit/13943c8f857b22f073d30f0ef9b725a0d255f1a4
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-rfgq-q3w2-pmv2
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-rfgq-q3w2-pmv2
Get alerted when CVE-2026-112898 or the next vulnerability affects your stack