Pillow libtiff TIFF Encoder TIFFSetField Argument Type Mismatch (CVE-2026-112902)
Detects the presence, deployment, and exploitation exposure of CVE-2026-112902, a CWE-686 (Function Call With Incorrect Argument Type) vulnerability in the Pillow Python imaging library through version 12.3.0. When saving/encoding TIFF images via the libtiff encoder, Pillow passes arguments to libtiff's TIFFSetField() whose C types do not match libtiff's variadic definitions for certain tags, leading to memory corruption / undefined behavior that can be triggered by crafting a malicious TIFF file or by supplying crafted TIFF tag metadata to an application that re-encodes images with Pillow. A public PoC/advisory exists (GHSA-xvh5-g6gv-559v). The issue is fixed in Pillow 13.0.0. This detection surfaces vulnerable Pillow installations and runtime behaviors (Python processes importing PIL and encoding TIFFs, crashes/SIGSEGV in Python workers handling image uploads) so responders can inventory and remediate.
Based on GHSA-xvh5-g6gv-559v, Pillow libtiff TIFFSetField argument type advisory
Vulnerability Intelligence
Public PoCAffected Software
- Vendor
- python
- Product
- pillow
- Versions
- < 13.0.0
Weakness (CWE)
Timeline
- Disclosed
- November 5, 2026
References & Proof of Concept
CVSS
What is CVE-2026-112902 Pillow libtiff TIFF Encoder TIFFSetField Argument Type Mismatch (CVE-2026-112902)?
Pillow libtiff TIFF Encoder TIFFSetField Argument Type Mismatch (CVE-2026-112902) (CVE-2026-112902) maps to the Impact and Initial Access tactics — the adversary is trying to manipulate, interrupt, or destroy your systems and data in MITRE ATT&CK.
This page provides production-ready detection logic for Pillow libtiff TIFF Encoder TIFFSetField Argument Type Mismatch (CVE-2026-112902), covering the data sources and telemetry it touches: Microsoft Defender for Endpoint, Device Software Inventory, Process Creation. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Impact Initial Access
// df00tech DF00-eafc571bfe · https://df00tech.com/detections/CVE-2026-112902 · licence: https://df00tech.com/detections/licence
// Identify hosts with vulnerable Pillow (< 13.0.0) via software inventory and runtime import telemetry
let VulnerableFloor = "13.0.0";
// Path 1: Installed-software inventory (MDE device software inventory / vuln mgmt)
DeviceTvmSoftwareInventory
| where SoftwareName has "pillow" or SoftwareName has "PIL"
| extend verParts = split(SoftwareVersion, ".")
| extend major = toint(verParts[0])
| where major < 13
| project Timestamp=now(), DeviceId, DeviceName, SoftwareName, SoftwareVersion, Signal="installed-vulnerable-pillow"
| union (
// Path 2: Runtime — python processes loading PIL's C imaging extension and touching TIFF
DeviceProcessEvents
| where FileName in~ ("python.exe","python3.exe","python","python3","pythonw.exe")
| where ProcessCommandLine has_any ("PIL","Pillow","Image.save",".tiff",".tif","libtiff","TiffImagePlugin")
| project Timestamp, DeviceId, DeviceName, SoftwareName=FileName, SoftwareVersion=ProcessCommandLine, Signal="runtime-pillow-tiff"
) Finds installed vulnerable Pillow versions (major < 13) from Defender TVM software inventory and correlates with Python processes that load PIL and handle TIFF encoding at runtime.
Data Sources
Required Tables
False Positives
- Legitimate batch image-processing jobs that encode TIFFs with Pillow on servers that have not yet been patched.
- Developer workstations running Pillow in virtualenvs where the inventory version differs from the active interpreter's version.
- Security/scanning tooling that itself bundles Pillow for thumbnailing or OCR preprocessing.
Query fingerprint DF00-eafc571bfe · licence
Sigma logsource & community rules
The detection logic for Pillow libtiff TIFF Encoder TIFFSetField Argument Type Mismatch (CVE-2026-112902) (CVE-2026-112902) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for CVE-2026-112902
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 Report installed Pillow version
Expected signal: Process creation event for python3 with command line referencing PIL.
- Test 2 Encode a TIFF with the libtiff backend
Expected signal: python3 process writing a .tiff file with PIL/TiffImagePlugin on the command line.
- Test 3 Save TIFF with custom tags to stress TIFFSetField path (Windows)
Expected signal: python.exe process creation with .tiff and PIL on the command line.
Response Playbook
Triage
- Confirm the Pillow version on the alerting host: run `python -c "import PIL; print(PIL.__version__)"` for each interpreter/virtualenv; any version < 13.0.0 is vulnerable to CVE-2026-112902.
- Determine whether the application actually encodes/saves TIFF images with Pillow (Image.save(..., format='TIFF') or libtiff backend) versus only decoding/other formats, encoding is the trigger path.
- Identify whether TIFF input or tag metadata is attacker-influenced (file uploads, email attachments, user-supplied images) to assess real exploitability versus latent exposure.
- Check for crash evidence: Python worker SIGSEGV, core dumps, or abnormal non-zero exits correlated with TIFF handling around the alert time.
Containment
- Patch Pillow to 13.0.0 or later (`pip install --upgrade 'Pillow>=13.0.0'`) in every affected environment/virtualenv and redeploy the application.
- As an interim mitigation, disable TIFF encoding/save paths or reject TIFF uploads at the application edge until the upgrade is deployed.
- Isolate or rate-limit internet-facing services that re-encode untrusted TIFFs if crash/exploitation activity is observed.
Evidence Collection
- Capture the exact Pillow version, Python interpreter path, and installed libtiff version from the affected host.
- Preserve any core dumps, crash logs, and the triggering TIFF file(s) or request payloads for forensic analysis.
- Record process-creation and process-exit telemetry for the Python workers around the event window.
Escalation Criteria
- ! Escalate to IR if a repeatable Python crash/SIGSEGV is tied to attacker-supplied TIFF content, indicating active exploitation attempts.
- ! Escalate if the vulnerable service is internet-facing and processes untrusted image uploads, given the 8.3 CVSS and public PoC.
- ! Escalate if evidence of memory-corruption follow-on activity (unexpected child processes, outbound connections) is seen from the image-processing worker.
Investigation Guide
Forensic Artifacts
- >
Core dumps / crash reports from Python worker processes - >
The triggering TIFF file and its tag metadata - >
Installed Pillow and libtiff version records (pip metadata, package manager logs)
Tuning Guidance
Begin with software-inventory signals (installed Pillow major < 13) which are high-fidelity for exposure; treat runtime command-line and crash-correlation signals as lower-confidence enrichment. Suppress known, patched batch-processing hosts and allowlist internal image pipelines that cannot accept untrusted input. Promote severity where the service is internet-facing and accepts untrusted TIFF uploads.
Hunting Queries
Inventory sweep for Pillow installations older than 13.0.0 across the estate.
// df00tech DF00-eafc571bfe · https://df00tech.com/detections/CVE-2026-112902 · licence: https://df00tech.com/detections/licence
DeviceTvmSoftwareInventory | where SoftwareName has "pillow" | extend major=toint(split(SoftwareVersion,".")[0]) | where major < 13 | project DeviceName, SoftwareVersion ``` df00tech DF00-eafc571bfe · https://df00tech.com/detections/CVE-2026-112902 · licence: https://df00tech.com/detections/licence ```
index=inventory sourcetype="software:inventory" product=pillow | rex field=version "^(?<major>\d+)" | where major < 13 | table host version Atomic Red Team Tests
Inventory check that prints the active Pillow version to confirm vulnerable (< 13.0.0) exposure.
Command
python3 -c "import PIL; print('Pillow', PIL.__version__)" Cleanup
echo 'no cleanup required' Expected Telemetry
Process creation event for python3 with command line referencing PIL.
Expected Detection
Runtime Pillow import signal / inventory version match fires when version major < 13.
Exercises the vulnerable TIFF encoder code path by saving an image as TIFF using Pillow's libtiff backend in a lab environment.
Command
python3 -c "from PIL import Image, TiffImagePlugin; TiffImagePlugin.WRITE_LIBTIFF=True; Image.new('RGB',(64,64)).save('/tmp/atomic_cve_112902.tiff', format='TIFF')" Cleanup
rm -f /tmp/atomic_cve_112902.tiff Expected Telemetry
python3 process writing a .tiff file with PIL/TiffImagePlugin on the command line.
Expected Detection
Runtime Pillow-TIFF encoding signal (kql/spl/eql) matches the python TIFF-save process.
Encodes a TIFF with custom tiffinfo tags via the libtiff backend, exercising the TIFFSetField argument-type path on Windows for detection validation.
Command
python -c "from PIL import Image, TiffImagePlugin; TiffImagePlugin.WRITE_LIBTIFF=True; im=Image.new('RGB',(32,32)); im.save(r'C:\\Windows\\Temp\\atomic_112902.tiff', format='TIFF', tiffinfo={317:2, 278:16})" Cleanup
del C:\Windows\Temp\atomic_112902.tiff Expected Telemetry
python.exe process creation with .tiff and PIL on the command line.
Expected Detection
CrowdStrike/KQL runtime Pillow-TIFF signal matches the python.exe TIFF-encode process.
Related Detections
Tactic Hubs
Related Techniques
Same Tactic: Impact
Browse by tactic
- Reconnaissance TA0043
- Resource Development TA0042
- Initial Access TA0001
- Execution TA0002
- Persistence TA0003
- Privilege Escalation TA0004
- Stealth TA0005
- Defense Impairment TA0112
- Credential Access TA0006
- Discovery TA0007
- Lateral Movement TA0008
- Collection TA0009
- Command and Control TA0011
- Exfiltration TA0010
- Impact TA0040