CVE-2026-112897 in Pillowinfo

Summary

by MITRE • 10/20/2026

Pillow is a Python imaging library. From 5.3.0 until 13.0.0, Pillow can return uninitialized memory as pixels when libtiff performs a short decode of JPEG-compressed or Group 4 fax TIFF data. The _decodeStrip and _decodeTile buffers can be larger than the bytes written by libtiff, but Pillow converts the expected rows without clearing the unwritten tail. The tile path is affected from 5.3.0 and the strip path from 6.0.0. An attacker can supply a crafted TIFF to an application that loads and returns or re-encodes its pixels. This can disclose stale heap contents without memory corruption or a process crash. This issue is fixed in version 13.0.0.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 10/20/2026

The vulnerability identified involves the Pillow Python imaging library, specifically affecting versions from 5.3.0 through 13.0.0. Pillow serves as a widely used image processing package that supports various formats including TIFF and JPEG. The core issue arises during the decoding of specific types of TIFF data where libtiff performs a short decode operation on either JPEG-compressed or Group 4 fax encoded content within a TIFF container. In these scenarios, the internal buffers utilized by Pillow for decoding strips and tiles are allocated with sizes that exceed the actual number of bytes written by the underlying libtiff library during the decompression process.

The technical flaw lies in how Pillow handles the conversion of expected image rows from these decoded buffers. When libtiff completes its decode operation, it writes only a portion of the pre-allocated buffer space if the data is truncated or shorter than anticipated due to compression artifacts or specific file structures. However, Pillow proceeds to convert and return pixel data based on the full expected dimensions without clearing or zeroing out the unwritten tail end of these buffers. This oversight results in the exposure of uninitialized memory contents that reside in those buffer regions prior to the decode operation.

This behavior constitutes an information disclosure vulnerability classified under CWE-200, which covers Exposure of Sensitive Information to an Unauthorized Actor. Furthermore, it aligns with ATT&CK technique T1537, specifically related to Data from Cloud Storage or Local System Memory being exfiltrated through improper handling of memory buffers. The attack vector requires an adversary to supply a crafted TIFF file to an application that utilizes Pillow for loading images and subsequently returning pixel data or re-encoding the image. By doing so, the attacker can trigger the short decode path in libtiff, leading to the leakage of stale heap contents from the target process memory space.

The operational impact is significant because it allows for the disclosure of sensitive information without causing a denial of service through memory corruption or application crashes. The leaked data may contain remnants of previous operations within the same memory region, potentially including cryptographic keys, user credentials, session tokens, or other proprietary data processed by the vulnerable application prior to this specific image processing task. This makes it particularly dangerous in server-side applications that process untrusted images and return them directly to clients without proper sanitization of internal buffer states.

Mitigation strategies primarily involve upgrading Pillow to version 13.0.0 or later, where this issue has been resolved by ensuring that buffers are properly initialized before use. For environments unable to upgrade immediately, defensive coding practices should be implemented such as validating image dimensions against actual decoded data lengths and explicitly zeroing out buffer tails after decoding operations if custom patches are applied. Additionally, applications processing untrusted images should operate in isolated sandboxed environments with restricted memory access privileges to limit the potential impact of any successful information disclosure attempts. Regular security audits focusing on third-party library usage patterns can also help identify similar risks where uninitialized memory might be exposed due to improper buffer management practices.

Responsible

GitHub M

Reservation

10/19/2026

Disclosure

10/20/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

low

Sources

Do you know our Splunk app?

Download it now for free!