CVE-2026-128066: Pillow memory denial of service in TIFF and EXIF parsing

CVE-2026-128066 · Severity: medium · Published 2026-11-13

Pillow, a widely-used image processing library, has a memory exhaustion vulnerability in how it parses TIFF and EXIF image metadata. An attacker can craft a small image file (a few hundred KB) that causes the application to allocate and retain thousands of times its own size in memory when opened or processed, crashing or freezing the service handling the image. This affects image upload services, thumbnail generators, and any application that calls Image.open() on TIFF/JPEG files or getexif() on PNG/JPEG/WebP images.

Technologies: Pillow, pillow (PyPI). Vendors: Pillow, PyPI.

Quick answers

Is CVE-2026-128066 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-128066 being exploited in the wild.
How severe is CVE-2026-128066?
Medium severity, published 13 November 2026.
Which products and versions are affected?
Pillow 1.0 and later (all versions prior to fix); pillow (PyPI) <= 12.3.0.
Is there a fix for CVE-2026-128066?
Yes: fixed in Pillow (fix applied via stream-length bounded tag data check; version not specified in advisory). Until then: Apply the provided patch which bounds out-of-line tag data to the length of the stream being parsed. Alternatively, restrict file uploads to trusted sources, disable EXIF parsing via getexif() if not needed, or set resource limits on worker processes to fail faster on DoS attempts rather than hanging indefinitely. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-128066 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-128066?
Check whether you run Pillow or pillow (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Fixed in: Pillow (fix applied via stream-length bounded tag data check; version not specified in advisory)

Apply the provided patch which bounds out-of-line tag data to the length of the stream being parsed. Alternatively, restrict file uploads to trusted sources, disable EXIF parsing via getexif() if not needed, or set resource limits on worker processes to fail faster on DoS attempts rather than hanging indefinitely.

Technical details

The vulnerability exists in ImageFileDirectory_v2.load() in TiffImagePlugin.py, which parses IFD (Image File Directory) entries by reading out-of-line tag values into memory. The parser does not bound the cumulative size of reads across multiple entries, and does not detect when multiple entries point to overlapping regions of the file. An attacker can create N directory entries with distinct private tag numbers but identical (offset, count) pairs covering the entire file, causing memory allocation to grow as O(N × filesize). Since the IFD itself costs only 12 bytes per entry, the total cost is quadratic in file size. This code path is reached during Image.open() for TIFF and JPEG, and during getexif() for PNG, JPEG, WebP and MPO files.

Affected products

  • Pillow Pillow 1.0 and later (all versions prior to fix)

Identifiers

  • CVE-2026-128066
  • GHSA-wqgw-9xfh-qf2g

Timeline

  • 2026-11-12: disclosed: Advisory published
  • 2010-07-30: other: Vulnerable code introduced with PIL 1.1.7 import

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.