Mend.io Vulnerability Database
The largest open source vulnerability database
What is a Vulnerability ID?
New vulnerability? Tell us about it!
CVE-2026-112902
Published:October 17, 2026
Updated:October 21, 2026
A crafted TIFF file of a few hundred bytes makes Pillow copy an attacker-chosen amount of its own process memory into the TIFF it writes back out, or crash the process outright. The trigger is an ordinary "Image.open()" followed by a bare "im.save(fp, "TIFF")". The only precondition is that the application re-saves images as TIFF. When the uploaded file is compressed, Pillow routes that save through libtiff automatically, with no options from the application. The attached reproducer does this with a 356-byte LZW TIFF: one crafted tag comes back holding 65536 bytes taken from "_imaging.so"'s read-only data, and a second crafted tag makes the worker die with SIGSEGV on every run. The bug is in "PyImaging_LibTiffEncoderNew" ("src/encode.c"). It decides what arguments to pass to the variadic "TIFFSetField()" from the shape of the Python value (scalar, tuple or bytes). It assumes its "ImagingLibTiffMergeFieldInfo()" call defined how libtiff will read them. But "TIFFMergeFieldInfo()" never overrides libtiff's built-in field table, so libtiff reads the arguments according to its own definition of the tag: - For a counted array tag such as DNGPrivateData (50740), a count-1 integer in the source file is taken as the byte count. The data pointer is then read from an argument slot Pillow never wrote, and that many bytes are copied into the output. - For a fixed-size array tag such as ActiveArea (50829), the integer itself is used as the source address. Where that unwritten slot points depends on the compiler. In the tested clang build it points into "_imaging.so", and a larger count returned thousands of pointers into libpython, libc and libtiff, which defeats address-space randomisation for anyone chaining another bug. When the application preserves metadata with "tiffinfo=im.tag_v2", a 64-bit entry turns ActiveArea into a 16-byte read from an address the attacker chooses. All observed memory errors are reads; no out-of-bounds write was found. Other branches of the same loop share the defect and are reachable from crafted TIFFs or from EXIF in JPEG/PNG/WebP re-saved as compressed TIFF. These are the "bytes", RATIONAL-tuple and typed-tuple branches, and a BYTE-typed ColorMap. The file-reachable forwarding was introduced in "a3d45e9cefd0" ("Added custom int and float TIFF tags") and first released in 5.4.0.
Affected Packages
pillow (CONDA):
Affected version(s) >=2.1.0 <13.0.0
Fix Suggestion:
Update to version 13.0.0
https://github.com/python-pillow/Pillow.git (GITHUB):
Affected version(s) >=12.0.0 <13.0.0
Fix Suggestion:
Update to version 13.0.0
pillow (PYTHON):
Affected version(s) >=1.0 <13.0.0
Fix Suggestion:
Update to version 13.0.0
pillow (PYTHON):
Affected version(s) >=12.0.0 <13.0.0
Fix Suggestion:
Update to version 13.0.0
Do you need more information?
Contact Us
CVSS v4
Base Score:
8.8
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
NONE
Vulnerable System Availability
HIGH
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
9.1
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
HIGH
Weakness Type (CWE)
Function Call With Incorrect Argument Type