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

Detect Pillow JPEG Decoder Draft-Scale Heap Buffer Overflow (CVE-2026-112403) in IBM QRadar

Detects presence and exploitation risk of CVE-2026-112403, a heap-based buffer overflow (CWE-122) in the Python Pillow imaging library prior to 13.0.0 (<= 12.3.0 affected). Pillow's JPEG decoder can write a full-width scanline into a buffer sized for a requested draft scale, corrupting adjacent heap memory. An attacker who can supply a crafted JPEG to an application that uses Image.draft() or thumbnail-style decoding with scaling can trigger heap corruption, potentially leading to denial of service or remote code execution (CVSS 9.2). A public PoC exists via the GHSA advisory. This detection surfaces vulnerable Pillow installations, suspicious image-processing crashes, and anomalous JPEG ingestion against image-handling services.

Based on GHSA-8g5g-8vmr-9782, Pillow JPEG decoder draft-scale heap overflow

MITRE ATT&CK

Tactic
Initial Access Execution

QRadar Detection Query

IBM QRadar (QRadar)
sql
-- df00tech DF00-a48cd5e74a · https://df00tech.com/detections/CVE-2026-112403 · licence: https://df00tech.com/detections/licence
SELECT sourceip, "Process Name" AS proc, "Command Line" AS cmd, QIDNAME(qid) AS event FROM events WHERE ("Process Name" ILIKE '%python%') AND ("Command Line" ILIKE '%PIL%' OR "Command Line" ILIKE '%Pillow%' OR "Command Line" ILIKE '%Image.draft%' OR "Command Line" ILIKE '%thumbnail%') AND (QIDNAME(qid) ILIKE '%crash%' OR QIDNAME(qid) ILIKE '%segmentation%' OR QIDNAME(qid) ILIKE '%core dump%') LAST 24 HOURS
high severity low confidence

Searches QRadar event data for Python processes running PIL/Pillow image-decode operations associated with crash or segmentation-fault events, indicative of CVE-2026-112403 exploitation.

Data Sources

Endpoint detection logsOS syslog

Required Tables

events

False Positives & Tuning

  • Non-exploit Python crashes
  • QA pipelines processing malformed test images
  • Resource exhaustion causing unrelated segfaults

Other platforms for CVE-2026-112403


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 execution of python3/pip with Pillow version string in output and software-inventory record.

  2. Test 2 Install vulnerable Pillow in isolated venv

    Expected signal: pip install process events and a Pillow 12.3.0 package record on the host.

  3. Test 3 Decode a draft-scaled JPEG with Pillow (lab PoC harness)

    Expected signal: python3 process with command line referencing PIL/Image.draft; on a crafted input, a SIGSEGV / core dump / abnormal termination.


Response Playbook

Triage

  1. Confirm the installed Pillow version on the affected host with `python3 -c "import PIL; print(PIL.__version__)"` or `pip show pillow`; versions <= 12.3.0 (anything < 13.0.0) are vulnerable.
  2. Determine whether the host runs an application that decodes untrusted/user-supplied JPEG images, especially using Image.draft() or thumbnail/scaled decoding, these code paths trigger the draft-scale overflow.
  3. Review surrounding logs for crash signatures (SIGSEGV, core dumped, malloc/heap errors) correlated with image uploads to establish whether exploitation was attempted.
  4. Identify the ingress point of any suspicious JPEG (upload endpoint, email attachment, message queue) and retain the sample for analysis.

Containment

  1. Upgrade Pillow to 13.0.0 or later across all affected hosts and rebuild/redeploy dependent application images.
  2. If immediate patching is not possible, disable or gate untrusted image ingestion, or reject JPEGs at the application edge until patched, and run the image-processing worker under a restricted, sandboxed, non-privileged account.
  3. Isolate any host showing confirmed heap-corruption/crash exploitation evidence pending forensic review.

Evidence Collection

  1. Preserve the crafted JPEG sample(s) and compute hashes for threat-intel correlation.
  2. Collect core dumps, application stack traces, and process crash logs from the time window of suspected exploitation.
  3. Export the software inventory record showing the vulnerable Pillow version and the full command line of the image-processing process.

Escalation Criteria

  • !Escalate to incident response if a crash correlates with a crafted JPEG and is followed by anomalous child-process execution or outbound connections, suggesting code execution.
  • !Escalate if the vulnerable, internet-facing service processes untrusted images and no compensating controls are in place.
  • !Escalate if multiple hosts or a shared base container image are found vulnerable, indicating broad exposure.

Investigation Guide

Forensic Artifacts

  • >Core dump / crash log of the Python process at the moment of JPEG decode
  • >The malicious JPEG file and its hash
  • >pip/conda package metadata recording the installed Pillow version
  • >Application upload logs tying a request to the decode crash

Tuning Guidance

To reduce noise, scope the process/crash correlation to hosts and services that actually decode untrusted images (upload handlers, thumbnailers, document pipelines). Exclude known CI/QA hosts that deliberately process malformed images, and OOM-driven crashes on memory-constrained hosts. The software-inventory arm of the KQL/SPL queries is high-precision for exposure assessment and can be run on its own as a vulnerability-management sweep; the crash-correlation arm is the exploitation signal and benefits from a short time window (<=30s) between decode and termination.


Hunting Queries

Enumerate all hosts running a Pillow version below the fixed 13.0.0 release to scope exposure.

Hunting — KQL
kql
// df00tech DF00-a48cd5e74a · https://df00tech.com/detections/CVE-2026-112403 · licence: https://df00tech.com/detections/licence
DeviceTvmSoftwareInventory | where SoftwareName in~ ("pillow","Pillow") | extend ver=parse_version(SoftwareVersion) | where ver < parse_version("13.0.0") | project DeviceName, SoftwareVersion
Hunting — SPL
spl
``` df00tech DF00-a48cd5e74a · https://df00tech.com/detections/CVE-2026-112403 · licence: https://df00tech.com/detections/licence ```
(index=inventory OR index=vuln) (product=pillow OR package=pillow) | eval major=tonumber(mvindex(split(replace(version,"[^0-9.]",""),"."),0)) | where major<13 | stats values(version) by host

Atomic Red Team Tests

Test 1 Enumerate installed Pillow version
linux

Checks whether the installed Pillow version is within the vulnerable range (< 13.0.0) to validate the inventory-based detection.

Command

bash
python3 -c "import PIL, sys; print('Pillow', PIL.__version__); sys.exit(0)" || pip show pillow | grep -i version

Cleanup

bash
echo 'no cleanup required'

Expected Telemetry

Process execution of python3/pip with Pillow version string in output and software-inventory record.

Expected Detection

Inventory arm of the detection flags the host if the reported version is < 13.0.0.

Test 2 Install vulnerable Pillow in isolated venv
linux

Creates a disposable virtualenv with a known-vulnerable Pillow release to generate inventory telemetry in a lab.

Command

bash
python3 -m venv /tmp/pilvuln && /tmp/pilvuln/bin/pip install 'pillow==12.3.0' && /tmp/pilvuln/bin/python -c "import PIL; print(PIL.__version__)"

Cleanup

bash
rm -rf /tmp/pilvuln

Expected Telemetry

pip install process events and a Pillow 12.3.0 package record on the host.

Expected Detection

Software-inventory detection flags Pillow 12.3.0 as < 13.0.0.

Test 3 Decode a draft-scaled JPEG with Pillow (lab PoC harness)
linux

Exercises the vulnerable draft-scale decode path against a JPEG to reproduce the decode/crash telemetry the detection correlates on. Run only in an isolated lab VM.

Command

bash
/tmp/pilvuln/bin/python -c "from PIL import Image; im=Image.open('/tmp/test.jpg'); im.draft('RGB',(32,32)); im.load(); print('decoded')"

Cleanup

bash
rm -f /tmp/test.jpg; rm -rf /tmp/pilvuln

Expected Telemetry

python3 process with command line referencing PIL/Image.draft; on a crafted input, a SIGSEGV / core dump / abnormal termination.

Expected Detection

Crash-correlation arm fires when the PIL decode process terminates abnormally within the correlation window.

Related Detections