NetSight
high8.4

CVE-2026-128067

Pillow: Heap buffer overflow saving TIFF with libtiff when tags override image size

Impact

Pillow is a Python imaging library. From 2.3.0 through 12.3.0, Pillow applications that save compressed TIFF images through libtiff can pass attacker-controlled image geometry tags to the encoder while allocating its row buffer from the actual image dimensions. The affected TiffImagePlugin._save path allows ImageWidth, ImageLength, or SamplesPerPixel from exif=, tiffinfo=, or a source TIFF IFD to make libtiff consume a larger scanline than the buffer supplied by ImagingLibTiffEncode. This can read heap memory into the generated TIFF or crash the process. When TIFF Predictor 2 is enabled, libtiff can rewrite the oversized scanline in place and corrupt memory beyond the buffer. A carried-over PlanarConfiguration value of 2 instead makes libtiff use a shorter scanline and can produce an undecodable output file, but is not established to cause the out-of-bounds access. This issue is fixed in version 13.0.0.

An attacker can exploit this over the network, without logging in, without any action by a user. Specific conditions have to be met, which makes an attack harder. If it succeeds: high risk of data being read, low risk of data or systems being changed, high risk of outages.

Affected packages

EcosystemPackageAffectedFixed in
pipPillow<= 12.3.013.0.0

Affected products · Python-pillow

ProductAffected versions
Pillow
from 2.3.0, before 13.0.0

Weakness classification

References