Detect CVE-2026-112398: Pillow FlashPix JPEG-Tile Decoder Heap Buffer Overflow (Out-of-Bounds Write) in Google Chronicle
Detects risk and exploitation indicators for CVE-2026-112398, a heap-based buffer overflow (CWE-122/CWE-787) in the Python Pillow imaging library prior to 13.0.0 (affecting versions <= 12.3.0). Pillow's FlashPix (FPX) JPEG-tile decoder can write decoded scanlines beyond the allocated tile buffer when processing a crafted FlashPix image, leading to heap corruption and potential remote code execution (CVSS 9.2). Because exploitation is driven by parsing an attacker-supplied image, detection focuses on (a) presence of vulnerable Pillow versions in the environment via package inventory and (b) runtime indicators such as Python processes crashing while decoding FlashPix/FPX files, image-processing workers ingesting .fpx files, and anomalous child processes/memory faults originating from Python image pipelines.
MITRE ATT&CK
- Tactic
- Initial Access Execution
YARA-L Detection Query
// df00tech DF00-5bd3fb570d · https://df00tech.com/detections/CVE-2026-112398 · licence: https://df00tech.com/detections/licence
rule cve_2026_112398_pillow_flashpix_overflow {
meta:
author = "Argus Detection Platform"
description = "Python process decoding FlashPix/.fpx images on a host with vulnerable Pillow (<13.0.0)"
cve = "CVE-2026-112398"
severity = "CRITICAL"
events:
$e.principal.process.file.full_path = /python[0-9.]*(\.exe)?$/ nocase
(
$e.target.process.command_line = /\.fpx/ nocase or
$e.target.process.command_line = /FlashPix/ nocase or
$e.target.process.command_line = /FpxImagePlugin/ nocase or
$e.target.file.full_path = /\.fpx$/ nocase
)
$e.principal.hostname = $host
match:
$host over 5m
condition:
$e
} Chronicle YARA-L rule matching Python processes that reference FlashPix/.fpx image artifacts, indicating use of the vulnerable Pillow FPX decoder.
Data Sources
Required Tables
False Positives & Tuning
- Approved image pipelines processing FlashPix files.
- DFIR/forensics tooling parsing FPX samples.
- Automated test suites exercising Pillow's FlashPix plugin.
Other platforms for CVE-2026-112398
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 Decode FlashPix image with vulnerable Pillow (benign PoC harness)
Expected signal: Process event: python3 with command line referencing FlashPix decode and opening a .fpx file; possible non-zero exit or segfault if the sample triggers the overflow.
- Test 2 Inventory check for vulnerable Pillow version
Expected signal: Package/osquery inventory event reporting Pillow with a version < 13.0.0.
- Test 3 FlashPix decode on Windows Python worker
Expected signal: ProcessRollup2/DeviceProcessEvents showing python.exe with a command line referencing a .fpx FlashPix decode.
References (5)
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-5x8w-8jj5-q52h
- https://github.com/python-pillow/Pillow/commit/242a059aedc1935097d9aa1dc3f099750467ba75
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0
- https://nvd.nist.gov/vuln/detail/CVE-2026-112398
- https://github.com/advisories/GHSA-5x8w-8jj5-q52h
Response Playbook
Triage
- Confirm the installed Pillow version on the affected host(s): run `python -c "import PIL; print(PIL.__version__)"` or inspect `pip show pillow`. Any version <= 12.3.0 (i.e., < 13.0.0) is vulnerable.
- Determine whether the host actually processes untrusted FlashPix/.fpx images (web upload handlers, thumbnailing, document/image conversion services). Hosts that never decode untrusted FPX input are lower priority.
- Review the triggering telemetry for the specific file decoded and its source, identify whether the .fpx file arrived from an external/untrusted channel (upload, email, shared drive).
- Check for Python process crashes, SIGSEGV/segfaults, or non-zero exits coinciding with FlashPix decoding, which may indicate overflow exploitation attempts rather than benign use.
Containment
- Upgrade Pillow to 13.0.0 or later across affected hosts and rebuild/redeploy any virtualenvs, containers, or images pinning the vulnerable version.
- As an interim mitigation, disable or block the FlashPix plugin where feasible (e.g., remove/neutralize FpxImagePlugin or reject .fpx uploads at the application layer) and quarantine suspicious .fpx files pending analysis.
- Isolate any host showing crash/memory-fault indicators tied to FlashPix decoding until forensic review confirms no code execution occurred.
Evidence Collection
- Preserve the suspicious .fpx file(s) and the full Python process command line, parent process, and user context from the triggering events.
- Collect crash artifacts: core dumps, Windows WER reports, dmesg/segfault entries, and application logs around the decode timestamp.
- Snapshot the host's installed Python package manifest (`pip freeze`) and container image digest to document the vulnerable Pillow version at time of event.
Escalation Criteria
- !Escalate to incident response if a Python image-processing worker crashed or spawned unexpected child processes (shell, network tooling) immediately after decoding a FlashPix file.
- !Escalate if the triggering .fpx file originated from an untrusted external source and the host runs a vulnerable Pillow version, as this matches the exploitable configuration (CVSS 9.2).
- !Escalate if evidence of memory corruption is accompanied by outbound network connections or persistence changes on the affected host.
Investigation Guide
Forensic Artifacts
- >
Core dumps / crash reports from the Python process at the time of FlashPix decoding. - >
The crafted .fpx file and its ingestion path (upload directory, mail attachment, shared storage). - >
Installed Pillow version evidence from `pip freeze`, site-packages, or container image layers. - >
Process ancestry and any anomalous child processes spawned by the Python image worker.
Tuning Guidance
Baseline which hosts legitimately decode FlashPix/.fpx files (document converters, media pipelines) and allowlist those services to reduce noise, while keeping the crash/memory-fault correlation active everywhere. Prioritize alerts that combine a vulnerable Pillow version (<13.0.0) with untrusted .fpx input or an abnormal Python exit. Once Pillow is upgraded to 13.0.0+ fleet-wide, downgrade the inventory-based rule to informational and retain the runtime crash correlation as a defense-in-depth check.
Hunting Queries
Hunts for any Python process handling FlashPix/.fpx images across endpoints, regardless of inventory data, to surface exposure and potential exploitation attempts.
// df00tech DF00-5bd3fb570d · https://df00tech.com/detections/CVE-2026-112398 · licence: https://df00tech.com/detections/licence
DeviceProcessEvents | where FileName has "python" | where ProcessCommandLine has_any (".fpx", "FlashPix", "FpxImagePlugin") | project Timestamp, DeviceName, AccountName, ProcessCommandLine, InitiatingProcessFileName ``` df00tech DF00-5bd3fb570d · https://df00tech.com/detections/CVE-2026-112398 · licence: https://df00tech.com/detections/licence ```
index=* (sourcetype=linux:python OR sourcetype=WinEventLog:*) (process=python* ) ("*.fpx*" OR "*FlashPix*" OR "*FpxImagePlugin*") | table _time host process command user Atomic Red Team Tests
In a lab, open a FlashPix (.fpx) file with a vulnerable Pillow version to generate the decode telemetry a detection should catch. Use a benign/malformed sample, not a weaponized payload.
Command
python3 -c "from PIL import Image; import sys; Image.open('sample.fpx').load()" ; echo exit=$? Cleanup
rm -f sample.fpx core core.* Expected Telemetry
Process event: python3 with command line referencing FlashPix decode and opening a .fpx file; possible non-zero exit or segfault if the sample triggers the overflow.
Expected Detection
KQL/SPL/CQL rules flag a Python process decoding a .fpx file on a host with vulnerable Pillow.
Enumerate the installed Pillow version to validate the inventory-based detection path.
Command
pip show pillow | grep -i version || python3 -c "import PIL; print('Pillow', PIL.__version__)" Cleanup
echo 'no cleanup required' Expected Telemetry
Package/osquery inventory event reporting Pillow with a version < 13.0.0.
Expected Detection
Inventory correlation in KQL/SPL/Sumo rules flags the host as running a vulnerable Pillow version.
Simulate a Windows image-processing worker decoding a FlashPix file with vulnerable Pillow to exercise Windows endpoint telemetry.
Command
python.exe -c "from PIL import Image; Image.open(r'C:\\lab\\sample.fpx').load()" Cleanup
del C:\lab\sample.fpx Expected Telemetry
ProcessRollup2/DeviceProcessEvents showing python.exe with a command line referencing a .fpx FlashPix decode.
Expected Detection
CrowdStrike CQL and KQL rules match the python.exe FlashPix decode command line.