Detect Pillow EpsImagePlugin Ghostscript Argument Injection (CVE-2026-112900) in Sumo Logic CSE
Detects exploitation of CVE-2026-112900, an argument injection vulnerability (CWE-78/CWE-88) in the Python Pillow imaging library (>= 2.6.0, < 13.0.0). When Pillow's EpsImagePlugin processes an EPS file, it invokes the external Ghostscript binary (gs) and passes an attacker-influenced input filename after -f without converting it to a safe absolute path. A filename beginning with a hyphen is read by Ghostscript as an option, allowing command-line argument injection. A filename beginning with @ causes Ghostscript to read additional arguments from the named file; if the attacker also controls that file, the chain can be escalated to arbitrary command execution. The issue reproduces under Pillow's default -dSAFER invocation and is fixed in Pillow 13.0.0. This detection surfaces anomalous Ghostscript process executions spawned from Python or web-application processes with suspicious argument patterns, as well as EPS processing by vulnerable Pillow versions.
Based on GHSA-w889-685w-c8fh, Pillow EpsImagePlugin Ghostscript argument injection
MITRE ATT&CK
- Tactic
- Initial Access Execution
Sumo Detection Query
// df00tech DF00-30e675dc04 · https://df00tech.com/detections/CVE-2026-112900 · licence: https://df00tech.com/detections/licence
_sourceCategory=*os*/process* ("gs" OR "gswin32c.exe" OR "gswin64c.exe")
| where (process_name = "gs" or process_name = "gs.exe" or process_name = "gswin32c.exe" or process_name = "gswin64c.exe")
| where (parent_process_name matches "*python*" or parent_process_name matches "*gunicorn*" or parent_process_name matches "*uwsgi*" or parent_process_name matches "*celery*" or parent_process_name matches "*w3wp.exe*" or parent_process_name matches "*node*")
| where (command_line matches "*-sOutputFile=%pipe%*" or command_line matches "*-dNOSAFER*" or command_line matches "*-dDELAYSAFER*" or command_line matches "*-sOutputFile=|*" or command_line matches "*-c *" or command_line matches "*../*")
| fields _messagetime, host, user, process_name, parent_process_name, command_line
| sort by _messagetime desc Sumo Logic search correlating Ghostscript process events with Python/web-server parents and EPS argument-injection command-line markers.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate Python-driven document/image conversions calling Ghostscript
- Scheduled rendering jobs using safe Ghostscript flags
- Pillow EPS test suite runs on build agents
Other platforms for CVE-2026-112900
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 Simulate Pillow EPS processing invoking Ghostscript with injected output pipe
Expected signal: Process-creation event: gs spawned by python3 with command line containing -sOutputFile=%pipe% and -c.
- Test 2 Simulate Ghostscript invocation with disabled sandbox (-dNOSAFER)
Expected signal: Process-creation event: gs spawned by python3 with -dNOSAFER on the command line.
- Test 3 Process a crafted EPS file through a vulnerable Pillow version
Expected signal: python3 process loads EPS and spawns a gs child process to render it.
References (5)
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-w889-685w-c8fh
- https://github.com/python-pillow/Pillow/commit/a2c363141da31a265dd536c945677db4b64f3ec9
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0
- https://nvd.nist.gov/vuln/detail/CVE-2026-112900
- https://github.com/advisories/GHSA-w889-685w-c8fh
Response Playbook
Triage
- Confirm the Ghostscript (gs) invocation was spawned by an application process (Python/web server) rather than an interactive user, and capture the full command line for injected arguments (-dNOSAFER, -sOutputFile=%pipe%, -c, path traversal).
- Identify the EPS/image file that triggered the invocation, correlate the parent process with recent file uploads or image-processing requests in application and web-server logs.
- Determine the installed Pillow version in the affected application environment (pip show Pillow / requirements lockfile); versions >= 2.6.0 and < 13.0.0 are vulnerable.
- Check whether Ghostscript's output or child processes attempted file reads/writes outside expected directories or network connections, indicating successful injection.
Containment
- Isolate or restrict the affected host/service and temporarily disable EPS/PostScript image processing in the application (e.g. reject EPS uploads at the ingress).
- Upgrade Pillow to >= 13.0.0 in the affected environment, or pin Ghostscript invocation behind -dSAFER and restrict its filesystem access.
Evidence Collection
- Preserve the suspicious EPS file, the full Ghostscript command line, and process-tree telemetry (parent/child PIDs, user context, timestamps).
- Collect application and web-server access logs around the event, including upload metadata, source IP, and session identifiers.
Escalation Criteria
- !Escalate to incident response if Ghostscript executed inline PostScript (-c), wrote to pipes/arbitrary paths, or if subsequent reverse-shell, outbound C2, or file-exfiltration activity is observed.
- !Escalate if the affected service is internet-facing and accepts untrusted image uploads, indicating active exploitation of this critical (CVSS 9.8) code-execution path.
Investigation Guide
Forensic Artifacts
- >
Malicious EPS file on disk or in application upload storage/temp directories - >
Process-creation records showing gs child of a Python/web-server parent with injected arguments - >
Ghostscript-created output files, pipes, or unexpected files in temp/web directories
Tuning Guidance
Baseline legitimate Ghostscript-from-Python invocations in your environment (document/PDF conversion, thumbnailing) and allowlist their known command-line shapes and parent services. Tighten the metacharacter/path-traversal regex to your actual output directories. If EPS processing is not used by any application, alert on ANY gs child of an application runtime regardless of arguments.
Hunting Queries
Hunt for Ghostscript executions spawned by Python with unsafe/injected arguments across the fleet.
// df00tech DF00-30e675dc04 · https://df00tech.com/detections/CVE-2026-112900 · licence: https://df00tech.com/detections/licence
DeviceProcessEvents | where FileName in~ ("gs","gs.exe","gswin64c.exe") | where InitiatingProcessFileName has "python" | where ProcessCommandLine has_any ("-dNOSAFER","%pipe%","-c ") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessCommandLine ``` df00tech DF00-30e675dc04 · https://df00tech.com/detections/CVE-2026-112900 · licence: https://df00tech.com/detections/licence ```
index=* EventCode=1 (process_name=gs OR process_name=gswin64c.exe) parent_process_name=python* | search process="*-dNOSAFER*" OR process="*%pipe%*" OR process="*-c *" | table _time host process parent_process_name Atomic Red Team Tests
Invokes Ghostscript the way Pillow would but with an injected -sOutputFile=%pipe% argument to generate the detection telemetry in a lab.
Command
python3 -c "import subprocess; subprocess.run(['gs','-q','-dNOPAUSE','-dBATCH','-sDEVICE=ppmraw','-sOutputFile=%pipe%id','-c','quit'])" Cleanup
rm -f /tmp/eps_poc_out* 2>/dev/null; true Expected Telemetry
Process-creation event: gs spawned by python3 with command line containing -sOutputFile=%pipe% and -c.
Expected Detection
KQL/SPL/EQL rules match on gs child of python with %pipe% and -c indicators.
Launches Ghostscript from a Python parent with -dNOSAFER to emulate argument injection disabling the sandbox.
Command
python3 -c "import subprocess; subprocess.run(['gs','-dNOSAFER','-dNOPAUSE','-dBATCH','-sDEVICE=nullpage','-c','quit'])" Cleanup
true Expected Telemetry
Process-creation event: gs spawned by python3 with -dNOSAFER on the command line.
Expected Detection
Rules match on gs child of python with -dNOSAFER indicator.
Creates a minimal EPS and opens it with Pillow to trigger the EpsImagePlugin Ghostscript invocation (run only on a disposable lab host with a vulnerable Pillow < 13.0.0).
Command
python3 -c "from PIL import Image; open('/tmp/poc.eps','w').write('%!PS-Adobe-3.0 EPSF-3.0\n%%BoundingBox: 0 0 100 100\nshowpage\n'); Image.open('/tmp/poc.eps').load()" Cleanup
rm -f /tmp/poc.eps 2>/dev/null; true Expected Telemetry
python3 process loads EPS and spawns a gs child process to render it.
Expected Detection
Rules flag the gs process spawned by python3 during EPS rendering.