CVE-2026-112398 Pillow: Heap buffer overflow in FlashPix (FPX) JPEG decoding leads to code execution
A heap buffer overflow in Pillow's FlashPix decoder allows arbitrary code execution when processing crafted files with optional dependencies installed.
- 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-112398?
CVE-2026-112398 is a critical 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 FlashPix JPEG-tile decoder can write decoded scanlines beyond the allocated tile buffer. FlashPix (FPX) JPEG decoding selects raw mode LA with two bytes per pixel, while an unrecognized JPEG mode can be decoded as JCS_UNKNOWN with four components, causing ImagingJpegDecode to write four-component scanlines into the two-byte tile buffer. An attacker can supply a crafted OLE2 FlashPix file to an application with the optional olefile dependency installed that opens or thumbnails untrusted input. This can corrupt heap memory and may allow arbitrary code execution. This issue is fixed in version 13.0.0.
Which versions are affected by CVE-2026-112398?
4 open source packages ship an affected version, including 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-112398?
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-112398 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-112398 exists.
Public exploit code: 1 proofs of concept on GitHub.
Other vulnerabilities in Python Pillow
Sources
Also known as BIT-pillow-2026-112398, DEBIAN-CVE-2026-112398, ECHO-8cd6-da78-619f, GHSA-5x8w-8jj5-q52h, PYSEC-2026-4330, ROOT-APP-PYPI-CVE-2026-112398 and 1 more.