Aider: Pillow: Memory disclosure and segfault in libtiff encoder via crafted TIFF tags (CVE-2026-112902)
Description
A vulnerability in Pillow's libtiff encoder allows crafted TIFF files to cause memory disclosure or process crashes during TIFF re-saving. The flaw arises from a mismatch between Pillow's argument passing to libtiff's TIFFSetField() and libtiff's internal tag definitions, leading to reading unintended memory or segfaults. This occurs when Pillow forwards unrecognized TIFF tags from the source file without properly consulting libtiff's field table. The issue affects applications that open and then save TIFF images, especially when metadata is preserved. No out-of-bounds writes were observed, only reads. The vulnerability was introduced in Pillow 5.4.0 and affects versions from 0.86.1_1 onward as per the provided data.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability exists in Pillow's TIFF encoder function PyImaging_LibTiffEncoderNew, where it incorrectly assumes that its own ImagingLibTiffMergeFieldInfo call overrides libtiff's internal tag field definitions. In reality, libtiff uses its built-in tag definitions to interpret variadic arguments passed to TIFFSetField(), causing a mismatch. For certain tags, such as DNGPrivateData (50740) and ActiveArea (50829), this leads to libtiff reading uninitialized or attacker-controlled arguments as pointers or counts, resulting in copying large amounts of process memory into output TIFF files or causing segmentation faults. This flaw can be triggered by opening a crafted TIFF file and saving it back as TIFF, with no special options required. The vulnerability affects multiple branches of the encoding loop and was introduced in Pillow version 5.4.0. The affected version range includes versions >=0.86.1_1 as provided. No evidence of out-of-bounds writes was found, only memory disclosure and crashes due to invalid reads.
Potential Impact
An attacker can craft a TIFF file that, when opened and re-saved by an application using Pillow, causes the application to disclose portions of its own process memory in the output TIFF file or crash with a segmentation fault. The disclosed memory includes read-only data segments from the Pillow imaging library and potentially other linked libraries, which could aid further exploitation by defeating address space layout randomization (ASLR). The crash can cause denial of service in applications processing such images. There is no indication of arbitrary code execution or memory corruption beyond read errors and crashes.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid re-saving TIFF images using Pillow when the source TIFF may be untrusted or crafted. Applications should consider disabling metadata preservation or avoid automatic routing through libtiff for TIFF saving. Monitor vendor channels for patches addressing the argument passing mismatch in the TIFF encoder. No generic mitigations are recommended beyond these specific precautions.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- BREW-aider-CVE-2026-112902
- Osv Schema Version
- 1.7.3
- Ecosystems
- ["Homebrew"]
- Cvss Version
- 4.0
Threat ID: 6ada44f34d27ba8daa6a5367
Added to database: 10/22/2026, 17:16:35 UTC
Last enriched: 10/22/2026, 17:33:51 UTC
Last updated: 10/22/2026, 17:33:51 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.