CVE-2026-112396 Pillow: Heap use-after-free when encoding TIFF to an in-memory buffer
A heap use-after-free in Pillow allows attackers to crash the process or potentially execute code by saving malicious TIFF tags to an in-memory buffer.
- 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-112396?
CVE-2026-112396 is a medium-severity use after free 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 11.3.0 until 13.0.0, Pillow has a heap use-after-free when libtiff rejects a tag while encoding TIFF data to an in-memory buffer. When an application saves attacker-influenced TIFF tags to BytesIO, libtiff can reject a tag during encoding in ImagingLibTiffEncode; the error path then frees the output buffer without closing or clearing the TIFF handle, and later cleanup flushes through the write callback into freed memory, which can crash the process and may enable code execution. This issue is fixed in version 13.0.0.
Weakness: CWE-416
Which versions are affected by CVE-2026-112396?
4 open source packages ship an affected version, including pillow. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pillow Bitnami | From 11.3.0 | 13.0.0 |
pillow PyPI | From 11.3.0 | 13.0.0 |
pillow PyPI | From 11.3.0 | 13.0.0 |
pillow PyPI | From 11.3.0 | 13.0.0 |
Products include Python Pillow.
How do I fix CVE-2026-112396?
Upgrade pillow to 13.0.0 or later.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is CVE-2026-112396 being exploited?
There is no known exploitation of CVE-2026-112396 in the wild and no public exploit code.
Other vulnerabilities in Python Pillow
Sources
Also known as BIT-pillow-2026-112396, DEBIAN-CVE-2026-112396, ECHO-a3cb-3fc2-be43, GHSA-4rr5-89j8-mwwm, PYSEC-2026-4328, UBUNTU-CVE-2026-112396.