PyPI: pillow
CVE-2026-112902
Safety vulnerability ID: SFTY-20261021-68388
Affected versions of the Pillow package are vulnerable to Function Call With Incorrect Argument Type (CWE-686) due to `PyImaging_LibTiffEncoderNew()` deciding the argument shape passed to libtiff's variadic `TIFFSetField()` from the Python value's type rather than from libtiff's own field definition. The function calls `ImagingLibTiffMergeFieldInfo()` assuming it overrides how libtiff interprets tag arguments, but `TIFFMergeFieldInfo()` leaves libtiff's built-in definitions intact for tags it already knows, so a scalar integer tag such as `DNGPrivateData` (50740) is read by libtiff as a `(count, pointer)` pair, and a tag such as `ActiveArea` (50829) is read as a raw pointer, consuming vararg slots Pillow never populated. An attacker can craft a small TIFF file containing specially chosen tag entries so that, when the victim application opens and re-saves it through `im.save(fp, "TIFF")`, Pillow's libtiff writer copies an attacker-controlled number of bytes from uninitialized memory into the output file (resulting in Information Disclosure of process memory and ASLR bypass) or dereferences an attacker-controlled address, crashing the worker process via SIGSEGV (Denial of Service).
Overview
Pillow: Memory disclosure and segfault in libtiff encoder via crafted TIFF tags
Advisory
pillow – Function Call With Incorrect Argument Type
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20261021-68388/CVE-2026-112902
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-xvh5-g6gv-559v
- https://github.com/python-pillow/Pillow/commit/af56ace297b0991d02988fcc2ea933e4824b4fb3
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0
- https://github.com/advisories/GHSA-xvh5-g6gv-559v
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
