Skip to content
CVE-2026-112900

Pillow EpsImagePlugin Ghostscript Argument Injection (CVE-2026-112900)

Initial Access Execution Last updated:

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

Vulnerability Intelligence

Public PoC

CVSS

9.8
Critical (9.0–10)
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

What is CVE-2026-112900 Pillow EpsImagePlugin Ghostscript Argument Injection (CVE-2026-112900)?

Pillow EpsImagePlugin Ghostscript Argument Injection (CVE-2026-112900) (CVE-2026-112900) maps to the Initial Access and Execution tactics — the adversary is trying to get into your network in MITRE ATT&CK.

This page provides production-ready detection logic for Pillow EpsImagePlugin Ghostscript Argument Injection (CVE-2026-112900), covering the data sources and telemetry it touches: Microsoft Defender for Endpoint, Process creation events. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Initial Access Execution
Microsoft Sentinel / Defender
kusto
// df00tech DF00-30e675dc04 · https://df00tech.com/detections/CVE-2026-112900 · licence: https://df00tech.com/detections/licence
DeviceProcessEvents
| where Timestamp > ago(30d)
| where FileName in~ ("gs", "gs.exe", "gswin32c.exe", "gswin64c.exe")
| where InitiatingProcessFileName in~ ("python", "python3", "python.exe", "python3.exe", "uwsgi", "gunicorn", "celery", "node", "httpd", "nginx", "w3wp.exe")
| where ProcessCommandLine has_any ("-dSAFER", "-dNOSAFER", "-dBATCH", "-dNOPAUSE", "-sDEVICE", "-sOutputFile", "-dEPSCrop")
| where ProcessCommandLine has_any ("-sOutputFile=%pipe%", "-sOutputFile=|", "-dDELAYSAFER", "-dNOSAFER", "%pipe%", "-c ", "run", "/tmp/", "../")
    or ProcessCommandLine matches regex @"-s\w+=.*[;&|`$]"
| project Timestamp, DeviceName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, AccountName, FolderPath
| order by Timestamp desc

Flags Ghostscript (gs) process executions initiated by Python or web-server processes carrying command-line arguments consistent with Pillow EPS argument injection, including output-to-pipe, unsafe sandbox flags, inline PostScript (-c), or shell metacharacters embedded in -s/-d options.

high severity medium confidence

Data Sources

Microsoft Defender for Endpoint Process creation events

Required Tables

DeviceProcessEvents

False Positives

  • Legitimate document/image conversion pipelines that invoke Ghostscript from Python (e.g. PDF thumbnailing) using -dSAFER/-dBATCH flags
  • Automated reporting or print jobs that render EPS/PS to PDF with standard Ghostscript options
  • Developer or CI test runs of Pillow's EPS test suite on build agents

Query fingerprint DF00-30e675dc04 · licence

Sigma logsource & community rules

The detection logic for Pillow EpsImagePlugin Ghostscript Argument Injection (CVE-2026-112900) (CVE-2026-112900) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: process_creation
  product: windows

Browse the community-maintained Sigma rules for this technique:


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

  2. Test 2 Simulate Ghostscript invocation with disabled sandbox (-dNOSAFER)

    Expected signal: Process-creation event: gs spawned by python3 with -dNOSAFER on the command line.

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


Response Playbook

Triage

  1. 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).
  2. 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.
  3. 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.
  4. Check whether Ghostscript's output or child processes attempted file reads/writes outside expected directories or network connections, indicating successful injection.

Containment

  1. 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).
  2. Upgrade Pillow to >= 13.0.0 in the affected environment, or pin Ghostscript invocation behind -dSAFER and restrict its filesystem access.

Evidence Collection

  1. Preserve the suspicious EPS file, the full Ghostscript command line, and process-tree telemetry (parent/child PIDs, user context, timestamps).
  2. 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.

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

Test 1 Simulate Pillow EPS processing invoking Ghostscript with injected output pipe
linux

Invokes Ghostscript the way Pillow would but with an injected -sOutputFile=%pipe% argument to generate the detection telemetry in a lab.

Command

bash
python3 -c "import subprocess; subprocess.run(['gs','-q','-dNOPAUSE','-dBATCH','-sDEVICE=ppmraw','-sOutputFile=%pipe%id','-c','quit'])"

Cleanup

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

Test 2 Simulate Ghostscript invocation with disabled sandbox (-dNOSAFER)
linux

Launches Ghostscript from a Python parent with -dNOSAFER to emulate argument injection disabling the sandbox.

Command

bash
python3 -c "import subprocess; subprocess.run(['gs','-dNOSAFER','-dNOPAUSE','-dBATCH','-sDEVICE=nullpage','-c','quit'])"

Cleanup

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

Test 3 Process a crafted EPS file through a vulnerable Pillow version
linux

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

bash
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

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

Related Detections

Blog posts about this detection

Browse by tactic

Full ATT&CK matrix Search all detections