Out-of-bounds Write Affecting pillow package, versions [,13.0.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.45% (40th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-PILLOW-22549579
  • published14 Nov 2026
  • disclosed12 Nov 2026
  • creditNicholas Carlini

Introduced: 12 Nov 2026

NewCVE-2026-128067  (opens in a new tab)
CWE-787  (opens in a new tab)

How to fix?

Upgrade pillow to version 13.0.0 or higher.

Overview

Affected versions of this package are vulnerable to Out-of-bounds Write via ImagingLibTiffEncode in src/libImaging/TiffDecode.c when saving a compressed TIFF through libtiff. In TiffImagePlugin._save's libtiff branch, only BitsPerSample is pinned to the real image when the encoder tag list is built; ImageWidth, ImageLength, and PlanarConfiguration are set from the image but are then overwritten by the exif=/tiffinfo= merge loop, and SamplesPerPixel is never set for single-band modes, allowing a value from caller-supplied or source-file tags to reach TIFFSetField. ImagingLibTiffEncode then passes a row buffer sized from the actual image to TIFFWriteScanline at line 1035 with no check against TIFFScanlineSize(), so libtiff reads a full scanline of the tag-described geometry from a buffer that holds only one row of the real image, leaking heap contents - including pointers - into the saved file, or crashing the process with SIGSEGV. When the metadata also enables TIFF Predictor=2, libtiff's horizontal differencing rewrites the scanline in place before encoding, turning the over-read into an out-of-bounds heap write that corrupts the allocator and aborts the process.

CVSS Base Scores

version 4.0
version 3.1