IT SBIT Services
Schneeberger
DEEN
CVE tracker

Pillow: Heap buffer overflow and data leak in TIFF saving to BytesIO

CVE-2026-112393Critical 9.2

← All vulnerabilities

Summary

Pillow, a Python imaging library, contains a heap buffer overflow in its TIFF writer when saving compressed TIFF images to in-memory targets such as io.BytesIO. An attacker who can supply an image to a service that re-opens and re-saves it as TIFF can crash the process, and code execution may be possible, although this is not demonstrated. Uninitialised heap bytes can also leak into compressed TIFF output larger than 64 KiB. Saves to real files are not affected.

Affected

  • Pillow 2.0.0 up to but not including 13.0.0 (the advisory lists versions up to 12.3.0)

Fixed in

  • Pillow 13.0.0

Workaround

  • Unknown. No vendor workaround is documented.
  • Until patched, save compressed TIFF images to real files instead of BytesIO when the input is untrusted, or disable TIFF upload handling in web applications.

Exploitation

  • A public reproducer is referenced in the advisory. It demonstrates a crash; code execution is not demonstrated.
  • CISA SSVC lists exploitation as poc and automatable as no.
  • No known exploitation in the wild is reported.

Our recommendation

  • Identify all Pillow installations, including transitive dependencies in virtualenvs and containers, for example with pip show pillow.
  • Upgrade to Pillow 13.0.0 or later. Check for version pins below 13 that block the upgrade.
  • Check whether any internet-facing service accepts user-supplied images and re-encodes them as TIFF; prioritise these systems.
  • Monitor application logs for crashes during image processing.

Public exploits

PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.

Research sources

Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 31 Oct 2026, 04:16.

Original description (NVD)

Pillow is a Python imaging library. From 2.0.0 until 13.0.0, Pillow has a heap buffer overflow and stale-heap disclosure in _tiffWriteProc when saving compressed TIFF data through libtiff to a target without a usable fileno(), such as BytesIO. The callback sizes its allocation from the prior buffer size instead of the current write position, allowing an attacker-controlled out-of-line TIFF tag or retained ICC profile to be copied beyond the allocation after libtiff seeks forward. This overflow can crash the process and may allow code execution. Independently, unwritten alignment gaps in compressed TIFF output larger than 64 KiB can disclose stale heap bytes without a crafted tag. File paths and targets with real file descriptors are unaffected. This issue is fixed in version 13.0.0.

NVD references (4)

Sources

The tracker combines official, freely usable data sources – updated continuously:

This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.

Affected? We can help.

We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.