Skip to content
CVE-2026-96639 IBM QRadar · QRadar

Detect Pillow Multi-Frame Loader Stale Native Storage Reuse (CVE-2026-96639) in IBM QRadar

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

QRadar Detection Query

IBM QRadar (QRadar)
sql
-- df00tech DF00-b245d5eba2 · https://df00tech.com/detections/CVE-2026-96639 · licence: https://df00tech.com/detections/licence
SELECT QIDNAME(qid) AS event, sourceip, destinationip, "Process Name" AS process, "Command Line" AS cmdline, DATEFORMAT(starttime,'yyyy-MM-dd HH:mm:ss') AS when FROM events WHERE ("Process Name" ILIKE '%python%' OR "Command Line" ILIKE '%gunicorn%' OR "Command Line" ILIKE '%celery%') AND ("Command Line" ILIKE '%PIL%' OR "Command Line" ILIKE '%Pillow%' OR "Command Line" ILIKE '%Image.open%' OR payload ILIKE '%segfault%' OR payload ILIKE '%SIGSEGV%') ORDER BY starttime DESC LAST 7 DAYS
high severity low confidence

Returns Python image-worker process events and crash payloads indicating decoding of untrusted multi-frame images with vulnerable Pillow.

Data Sources

Linux OS logsProcess Activity

Required Tables

events

False Positives & Tuning

  • Routine Python automation unrelated to image decoding
  • Crash payloads from unrelated native extensions
  • Benign batch media processing on trusted inputs

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.

  1. Test 1 Enumerate installed Pillow version

    Expected signal: Process launch of python3 importing PIL; stdout indicating VULNERABLE and the version string.

  2. 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.

  3. Test 3 Simulate image-worker crash signal

    Expected signal: SIGSEGV / core dumped entry in auditd/syslog referencing a python3 process; possible core dump artifact.


Response Playbook

Triage

  1. 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.
  2. Identify whether the host decodes untrusted, user-supplied images (upload handlers, avatar/thumbnail services, document converters) versus only trusted internal media.
  3. Review recent crash telemetry (SIGSEGV/SIGABRT/core dumps) and application logs from image-processing workers for the window since the 2026-10-22 disclosure.
  4. Pull and preserve any sample images that immediately preceded a worker crash for forensic analysis.

Containment

  1. Upgrade Pillow to 13.0.0 (the fixed release) in every affected environment and rebuild/redeploy container images that pin a vulnerable version.
  2. 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).
  3. Quarantine and stop processing any upload queue items identified as crafted multi-frame images until patched.

Evidence Collection

  1. Capture the exact Pillow version, Python version, and installed C codecs (libjpeg/zlib/libtiff) from each affected host.
  2. Collect core dumps, worker stdout/stderr, and the triggering image files; hash and store them in the incident evidence store.
  3. 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.

Hunting — KQL
kql
// 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
Hunting — SPL
spl
``` 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

Test 1 Enumerate installed Pillow version
linux

Check whether the local Python environment has a Pillow version in the vulnerable range.

Command

bash
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

bash
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.

Test 2 Decode a benign multi-frame image with Pillow
linux

Exercise the multi-frame loader code path on a safe, self-generated multi-frame image to generate representative decode telemetry (no corruption).

Command

bash
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

bash
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.

Test 3 Simulate image-worker crash signal
linux

Emit a SIGSEGV from a Python worker-like process to validate crash-signal based detections without using a real exploit.

Command

bash
python3 -c "import os, signal, sys; sys.stderr.write('PIL image worker fault simulation\n'); os.kill(os.getpid(), signal.SIGSEGV)" ; true

Cleanup

bash
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.

Related Detections