CVE-2026-112897: Pillow: TiffDecode returns uninitialized memory as pixels for short JPEG strips
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Pillowto a version that resolves this vulnerability.Fixed in 13.0.0
Event History
Frequently Asked Questions
Which Pillow installations are affected?
Pillow versions from 5.3.0 up to, but not including, 13.0.0 are affected through the TIFF tile decode path. The TIFF strip decode path is affected from 6.0.0 up to, but not including, 13.0.0.
What must an attacker be able to do to exploit this issue?
An attacker must be able to provide a crafted JPEG-compressed or Group 4 fax TIFF file to an application using Pillow. The application must load the image and return or re-encode its pixels for stale heap contents to be disclosed.
Does exploitation require authentication, user interaction, or a crash?
No authentication or user interaction is required according to the supplied CVSS vector. The issue discloses stale heap memory and does not require memory corruption or a process crash.
What is the remediation?
Upgrade Pillow to version 13.0.0, which fixes the issue. If upgrading cannot happen immediately, avoid accepting or processing untrusted JPEG-compressed or Group 4 fax TIFF files in workflows that expose or re-encode decoded pixels.