CVE-2026-128067: Out-of-Bounds Heap Read and Write in Pillow libtiff Encoder via Geometry Tag Overrides
Vulnerability ID: CVE-2026-128067
CVSS Score: 8.4
Published: 2026-11-12
CVE-2026-128067 is a memory corruption vulnerability in Pillow (versions 2.3.0 through 12.3.0) occurring when saving compressed TIFF images via the underlying libtiff encoder. By supplying crafted image geometry tags through exif=, tiffinfo=, or a source TIFF IFD, an attacker can override the scanline dimensions configured in libtiff while Pillow allocates the internal row buffer based strictly on the physical image dimensions. This mismatch induces an out-of-bounds heap read during scanline encoding, and escalates to an out-of-bounds heap write when TIFF Predictor 2 (horizontal differencing) is enabled.
TL;DR
Pillow versions 2.3.0 through 12.3.0 allow caller-supplied TIFF tags (ImageWidth, ImageLength, SamplesPerPixel) to override libtiff encoder geometry while allocating the scanline buffer from the actual image size.…