# CVE-2026-128067: Pillow heap buffer overflow in TIFF encoder with mismatched geometry tags

Source: https://junglewise.ai/threats/cve-2026-128067-pillow-heap-buffer-overflow-saving-tiff-with-libtiff-when-tags  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-11-13. Updated: 2026-11-12  
License: CC BY 4.0 with a link back

CVE-2026-128067 · Severity: high · Published 2026-11-13

Pillow's TIFF encoder allows metadata tags from uploaded images to override the actual image dimensions passed to libtiff, causing the encoder to read past or write into heap memory. An attacker can upload a specially crafted JPEG or TIFF to leak server process memory including pointers, or crash the worker process, when the application saves images with metadata preservation.

Technologies: [Pillow](https://junglewise.ai/threats/technologies/pillow-pillow), [pillow (PyPI)](https://junglewise.ai/threats/technologies/pillow). Vendors: [Pillow](https://junglewise.ai/threats/vendors/pillow), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-128067 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-128067 being exploited in the wild.

**How severe is CVE-2026-128067?** High severity, published 13 November 2026.

**Which products and versions are affected?** Pillow 8.4.0 and later; pillow (PyPI) <= 12.3.0.

**Is there a fix for CVE-2026-128067?** No fixed version is recorded yet. Disable TIFF output or restrict TIFF compression to raw (uncompressed) format. For applications using exif=im.getexif() or tiffinfo= with compressed TIFF, sanitize or strip geometry tags (ImageWidth, ImageLength, SamplesPerPixel, PlanarConfiguration) from user-supplied or carried-over metadata before passing to save(). If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-128067 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-128067?** 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


Disable TIFF output or restrict TIFF compression to raw (uncompressed) format. For applications using exif=im.getexif() or tiffinfo= with compressed TIFF, sanitize or strip geometry tags (ImageWidth, ImageLength, SamplesPerPixel, PlanarConfiguration) from user-supplied or carried-over metadata before passing to save().

## Technical details

The vulnerability is a heap buffer over-read and over-write in libtiff integration (CWE-787). When Pillow saves an image as compressed TIFF, geometry tags (ImageWidth, ImageLength, SamplesPerPixel, PlanarConfiguration) from supplied EXIF data or source file metadata overwrite the encoder's internally-set values, but the row buffer is still sized from the actual image. This causes TIFFWriteScanline to read a larger scanline than the buffer holds. With Predictor=2, libtiff's in-place horizontal differencing turns the over-read into a heap over-write on each row, corrupting memory and aborting the process.

## Affected products

- Pillow Pillow 8.4.0 and later

## Identifiers

- CVE-2026-128067
- GHSA-xcvg-w56q-r89m

## Timeline

- 2026-11-12: disclosed: Advisory published
- <UNKNOWN>: kev added

## Related threats

- [Pillow memory denial of service in TIFF and EXIF parsing](https://junglewise.ai/threats/cve-2026-128066-pillow-memory-dos-in-tiff-and-exif-ifd-parsing-via-overlapping)
- [Pillow libtiff encoder memory disclosure and crash via crafted TIFF tags](https://junglewise.ai/threats/cve-2026-112902-pillow-memory-disclosure-and-segfault-in-libtiff-encoder-via)
- [Pillow EPS load decompression bomb check bypass in Ghostscript scaling](https://junglewise.ai/threats/cve-2026-112899-pillow-eps-load-scale-lets-ghostscript-render-past-the)
- [Pillow heap buffer overflow in bundled libopenjp2](https://junglewise.ai/threats/pillow-bundled-libopenjp2-2-5-4-in-all-wheels-since-11-1-0-carries-osv-cd00a842)
- [Pillow Arrow export memory disclosure via row padding](https://junglewise.ai/threats/cve-2026-114501-pillow-is-a-python-imaging-library-from-11-2-1-until-13-0-0)
