CVE-2026-112397 Pillow: Out-of-bounds access in _imagingmorph on a zero-width image
An attacker can crash the application by supplying a zero-width image to Pillow's morphology operation, causing an out-of-bounds memory access.
- 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-112397?
CVE-2026-112397 is a high-severity memory corruption 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. Prior to 13.0.0, Pillow's ImageMorph.MorphOp.apply() can access memory before a row buffer for a zero-width image. PPM and PGM input can create an image with width zero, and the native morphology routine indexes outrow[width - 1] without rejecting that geometry. An attacker can supply such an image to an application that applies a morphology operation. This can crash the process. This issue is fixed in version 13.0.0.
Weakness: CWE-787
Which versions are affected by CVE-2026-112397?
4 open source packages ship an affected version, including pillow and Pillow. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pillow Bitnami | All versions | 13.0.0 |
pillow PyPI | All versions | 13.0.0 |
pillow PyPI | All versions | 13.0.0 |
Pillow PyPI | All versions | 13.0.0 |
Products include Python Pillow.
How do I fix CVE-2026-112397?
Upgrade pillow to 13.0.0 or later.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2026-112397 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-112397 exists.
Other vulnerabilities in Python Pillow
Sources
Also known as BIT-pillow-2026-112397, DEBIAN-CVE-2026-112397, ECHO-f5ec-3fe1-901d, GHSA-58r4-6rv3-gfh8, PYSEC-2026-4329, ROOT-APP-PYPI-CVE-2026-112397 and 1 more.