# CVE-2026-112902: Pillow libtiff encoder memory disclosure and crash via crafted TIFF tags

Source: https://junglewise.ai/threats/cve-2026-112902-pillow-memory-disclosure-and-segfault-in-libtiff-encoder-via  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-11-05. Updated: 2026-10-21  
License: CC BY 4.0 with a link back

CVE-2026-112902 · Severity: high · CVSS 4 · Published 2026-11-05

Pillow's TIFF encoder mishandles metadata tags when re-saving compressed TIFF images, allowing an attacker to leak thousands of bytes from the worker process's memory into the output file, or crash the process entirely. An ordinary image open-and-save operation triggered by a few-hundred-byte crafted TIFF file can extract sensitive data like encryption keys and memory addresses that defeat security protections, or cause denial of service on image processing services.

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-112902 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-112902 being exploited in the wild.

**How severe is CVE-2026-112902?** High severity, with a CVSS score of 4, published 5 November 2026.

**Which products and versions are affected?** Pillow 5.4.0 and later; pillow (PyPI) <= 12.3.0, ECOSYSTEM:introduced=0,fixed=13.0.0.

**Is there a fix for CVE-2026-112902?** Yes. pillow (PyPI): upgrade to 13.0.0 or later. Until then: Disable TIFF compression or use raw TIFF encoding if possible to avoid the libtiff writer path. Do not re-save TIFF images with inherited compression from untrusted sources. Restrict TIFF file upload and processing to trusted inputs only. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

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

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

- pillow (PyPI): upgrade to 13.0.0 or later

  ```sh
  pip install "pillow>=13.0.0"
  ```


Disable TIFF compression or use raw TIFF encoding if possible to avoid the libtiff writer path. Do not re-save TIFF images with inherited compression from untrusted sources. Restrict TIFF file upload and processing to trusted inputs only.

## Technical details

The encoder determines how to pass TIFF tag values to libtiff's variadic TIFFSetField() based on the Python value's shape (scalar, tuple, or bytes) rather than consulting libtiff's own field definition. For tags libtiff already knows (e.g., DNGPrivateData, ActiveArea), this causes a mismatch: a scalar integer meant as a tag value is consumed as either a byte count with an unwritten pointer argument (leaking process memory), or as a memory address itself (causing out-of-bounds reads and crashes). The vulnerability is triggered automatically when re-saving any compressed TIFF, without application-level control. Multiple code paths are affected including array types, RATIONAL tuples, and core tags with stale file-supplied types.

## Affected products

- Pillow Pillow 5.4.0 and later

## Identifiers

- CVE-2026-112902
- GHSA-xvh5-g6gv-559v
- PYSEC-2026-4363

## Timeline

- 2026-10-21: disclosed

## Related threats

- [Pillow heap buffer overflow in TIFF encoder with mismatched geometry tags](https://junglewise.ai/threats/cve-2026-128067-pillow-heap-buffer-overflow-saving-tiff-with-libtiff-when-tags)
- [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 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)
