home / blog

2026-11-30 · critical

CVE-2026-112393: Critical Heap Buffer Overflow in Pillow Library

Heap buffer overflow in Pillow versions before 13.0.0 allows potential code execution through TIFF files.

CVE-2026-112393: Critical Heap Buffer Overflow in Pillow Library

CVE-2026-112393 is a critical vulnerability in the Pillow library, a popular imaging library for Python. The flaw occurs in the _tiffWriteProc function where a heap buffer overflow can allow an attacker to execute arbitrary code through malicious TIFF files. The problem stems from the callback sizing its allocation from the prior buffer size instead of the current write position, allowing an attacker-controlled TIFF tag to be copied beyond the allocation after libtiff seeks forward.

The vulnerability is classified as critical with a CVSS score of 9.8. According to available data, public exploits already exist, as evidenced by GitHub reports that include proof of concept and exploit code. This represents a significant risk for organizations using Pillow for image processing, especially in environments where untrusted TIFF files are processed.

As a defense, it is crucial to immediately update Pillow to version 13.0.0 or later, which contains the fix for this vulnerability. For implementations that cannot be promptly updated, it is advisable to implement strict input controls on TIFF files, filtering any suspicious or untrusted files. Additionally, monitor systems for any exploitation attempts and implement appropriate mitigations until the patch can be applied.

At a glance

What
Heap buffer overflow and stale-heap disclosure in _tiffWriteProc when saving compressed TIFF data through libtiff to targets without a usable fileno(), such as BytesIO.
Severity
Critical (CVSS 9.8)
Affected versions
Pillow from 2.0.0 until 13.0.0
Fix
Version 13.0.0
Status
Patched
Action
Update to Pillow version 13.0.0 or later

Sources: NVD, CVE-2026-112393

← All articles