Detect Pillow Multi-Frame Loader Stale Native Storage Reuse (CVE-2026-96639) in Sumo Logic CSE
Detects exposure and exploitation surfaces for CVE-2026-96639, a critical (CVSS 9.8) out-of-bounds read/write in the Python Pillow imaging library. Multi-frame image loaders can reuse stale native image storage after an inter-frame mode transition. When frame 0 allocates native storage for a narrow mode such as L and a later frame of the same size switches to a wider mode such as RGB or CMYK, the C-level ImagingCore buffer is not reallocated, because ImageFile.load_prepare() only reallocates when _im is None. The decoder then writes wider pixels into the narrow buffer. The verified affected loaders are PSD, MPO/JPEG, DCX, and MIC. TIFF is not affected because its seek path already checks both mode and size before reusing storage. A crafted multi-frame image parsed with Pillow >= 11.0.0 and < 13.0.0 triggers CWE-125 (out-of-bounds read) and CWE-787 (out-of-bounds write), enabling memory disclosure or corruption. The report also demonstrated command execution through the MPO/JPEG path in matching Python and Pillow runtime profiles. Any service that decodes untrusted images may be exposed. Detection focuses on inventorying vulnerable Pillow installs, observing crash telemetry in image-processing workers, and spotting malformed multi-frame image uploads.
MITRE ATT&CK
- Tactic
- Initial Access Impact
Sumo Detection Query
// df00tech DF00-b245d5eba2 · https://df00tech.com/detections/CVE-2026-96639 · licence: https://df00tech.com/detections/licence
_sourceCategory=*linux* OR _sourceCategory=*app* ("python" OR "gunicorn" OR "celery" OR "uwsgi") ("PIL" OR "Pillow" OR "segfault" OR "SIGSEGV" OR "SIGABRT" OR "core dumped")
| parse regex "(?<signal>SIGSEGV|SIGABRT|segfault|core dumped)" nodrop
| count by _sourceHost, signal
| sort by _count Aggregates crash and abort signals from Python image-processing hosts to detect memory corruption triggered by malformed multi-frame images.
Data Sources
Required Tables
False Positives & Tuning
- Generic Python crashes not related to Pillow
- OOM-driven process termination
- Staging fuzz runs
Other platforms for CVE-2026-96639
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 Enumerate installed Pillow version
Expected signal: Process launch of python3 importing PIL; stdout indicating VULNERABLE and the version string.
- Test 2 Decode a benign multi-frame image with Pillow
Expected signal: python3 process launch with Image.open/ImageSequence in command line; file create of /tmp/cve96639_test.mpo.
- Test 3 Simulate image-worker crash signal
Expected signal: SIGSEGV / core dumped entry in auditd/syslog referencing a python3 process; possible core dump artifact.
References (6)
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-v9pv-5gc8-w2m6
- https://nvd.nist.gov/vuln/detail/CVE-2026-96639
- https://github.com/python-pillow/Pillow/pull/10105
- https://github.com/python-pillow/Pillow/commit/78d97d994579aef81aafe123773d525f40f2522a
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0
- https://github.com/advisories/GHSA-v9pv-5gc8-w2m6
Response Playbook
Triage
- Confirm the affected host runs Pillow >= 11.0.0 and < 13.0.0 by running `python3 -c "import PIL; print(PIL.__version__)"` in each relevant virtualenv/container, not just the system interpreter.
- Identify whether the host decodes untrusted, user-supplied images (upload handlers, avatar/thumbnail services, document converters) versus only trusted internal media.
- Review recent crash telemetry (SIGSEGV/SIGABRT/core dumps) and application logs from image-processing workers for the window since the 2026-10-22 disclosure.
- Pull and preserve any sample images that immediately preceded a worker crash for forensic analysis.
Containment
- Upgrade Pillow to 13.0.0 (the fixed release) in every affected environment and rebuild/redeploy container images that pin a vulnerable version.
- Where immediate patching is impossible, disable or sandbox multi-frame image decoding (reject PSD/MPO/DCX/MIC at the upload boundary) and run image workers under a restricted, non-privileged, memory-limited profile (seccomp/AppArmor).
- Quarantine and stop processing any upload queue items identified as crafted multi-frame images until patched.
Evidence Collection
- Capture the exact Pillow version, Python version, and installed C codecs (libjpeg/zlib/libtiff) from each affected host.
- Collect core dumps, worker stdout/stderr, and the triggering image files; hash and store them in the incident evidence store.
- Export process-creation and crash logs for the affected workers covering the suspected exploitation window.
Escalation Criteria
- !Escalate to IR if a worker crash is correlated with an untrusted upload and shows signs of memory corruption beyond a clean exception (e.g. heap corruption, unexpected child process, or outbound connection).
- !Escalate to incident command if evidence suggests code execution or data exfiltration from an image-processing service, given the CVSS 9.8 rating and public PoC.
Investigation Guide
Forensic Artifacts
- >
Core dumps and crash stack traces from Python image-processing workers referencing PIL/_imaging native frames - >
The triggering multi-frame image file (PSD/MPO/DCX/MIC) and its upload metadata - >
pip freeze / requirements.lock output capturing the deployed Pillow version
Tuning Guidance
Crash-based detections are noisy on hosts that also run unrelated native Python extensions or experience OOM kills; scope the SIEM queries to hosts tagged as image-processing workers and suppress known OOM events. Inventory-based detection (TVM/pip) is the highest-fidelity signal, prioritize it and treat process/crash queries as corroboration. Reduce false positives by allow-listing CI/fuzzing hosts and trusted internal media pipelines.
Hunting Queries
Find vulnerable Pillow installs and correlate with Python worker crash signals across the estate.
// df00tech DF00-b245d5eba2 · https://df00tech.com/detections/CVE-2026-96639 · licence: https://df00tech.com/detections/licence
DeviceTvmSoftwareInventory | where SoftwareName has "pillow" | extend v=parse_version(SoftwareVersion) | where v >= parse_version("11.0.0") and v < parse_version("13.0.0") | project DeviceName, SoftwareVersion ``` df00tech DF00-b245d5eba2 · https://df00tech.com/detections/CVE-2026-96639 · licence: https://df00tech.com/detections/licence ```
index=os ("SIGSEGV" OR "core dumped" OR "segfault") process="python*" | stats count by host, process | where count > 0 Atomic Red Team Tests
Check whether the local Python environment has a Pillow version in the vulnerable range.
Command
python3 -c "import PIL, sys; v=tuple(int(x) for x in PIL.__version__.split('.')[:3]); print('VULNERABLE' if (11,0,0) <= v < (13,0,0) else 'not vulnerable', PIL.__version__)" Cleanup
true Expected Telemetry
Process launch of python3 importing PIL; stdout indicating VULNERABLE and the version string.
Expected Detection
Inventory/KQL detection flags the host; process telemetry shows python3 invoking PIL.
Exercise the multi-frame loader code path on a safe, self-generated multi-frame image to generate representative decode telemetry (no corruption).
Command
python3 -c "from PIL import Image, ImageSequence; im=Image.new('L',(32,32),128); im2=Image.new('RGB',(32,32),(255,0,0)); im.save('/tmp/cve96639_test.mpo', save_all=True, append_images=[im2]); [f.load() for f in ImageSequence.Iterator(Image.open('/tmp/cve96639_test.mpo'))]" Cleanup
rm -f /tmp/cve96639_test.mpo Expected Telemetry
python3 process launch with Image.open/ImageSequence in command line; file create of /tmp/cve96639_test.mpo.
Expected Detection
EQL/Chronicle/CQL process-launch rules match the Pillow multi-frame decode invocation.
Emit a SIGSEGV from a Python worker-like process to validate crash-signal based detections without using a real exploit.
Command
python3 -c "import os, signal, sys; sys.stderr.write('PIL image worker fault simulation\n'); os.kill(os.getpid(), signal.SIGSEGV)" ; true Cleanup
rm -f core core.* 2>/dev/null; true Expected Telemetry
SIGSEGV / core dumped entry in auditd/syslog referencing a python3 process; possible core dump artifact.
Expected Detection
SPL/Sumo/QRadar crash-signal detections fire on the segfault from a python image worker.