Skip to main content

Pillow CVE-2026-112900

| EUVDEUVD-2026-104661 CRITICAL
OS Command Injection (CWE-78)
2026-10-19 GitHub_M GHSA-w889-685w-c8fh
9.2
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Upload/supply EPS file with crafted name
  2. Delivery
    Name begins with @ argument-file token
  3. Exploit
    Pillow passes it unmodified after -f
  4. Execution
    Ghostscript parses it as argument file
  5. Persist
    Injected Ghostscript args execute
  6. Impact
    Arbitrary command execution on host

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires the host application to pass an attacker-controlled filename into Pillow's EPS code path (EpsImagePlugin.Ghostscript) with Ghostscript installed. Argument injection requires only a filename beginning with '-' (interpreted as a Ghostscript option). Escalation to arbitrary command execution specifically requires a filename beginning with '@' (a Ghostscript argument-file token) AND attacker control of the contents of that referenced text file; the reported chain works even with the default -dSAFER invocation. Limiting factors: the application must not sanitize or re-root the filename before handing it to Pillow, Ghostscript must be present, and full RCE needs the secondary attacker-controlled argument file - plain argument injection is easier but the command-execution outcome is gated by these preconditions. Not exploitable in versions >=13.0.0 (filename is made absolute).

Impact

This is a genuine high-priority issue for applications that feed untrusted filenames into Pillow's EPS handling, but its real-world risk is more nuanced than the 9.2 CVSS 4.0 score suggests. The CVSS 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:N, VC:H/VI:H/VA:H) models network reach, no privileges, and no user interaction, but the AT:P (Attack Requirements: Present) flag is doing heavy lifting - it reflects that full command execution is NOT a simple one-shot: per the description, arbitrary command execution additionally requires a leading @ argument-file filename AND attacker control of the referenced text file's contents. Mere argument injection (hyphen-leading filename) is easy; weaponized RCE is conditional. No EPSS score was provided, so exploitation probability cannot be quantified. The vulnerability is NOT in CISA KEV and no POC flag was supplied, so there is no evidence of active exploitation; however, the upstream advisory and commit include a regression test demonstrating the argument-injection primitive, indicating the mechanism is well-understood and reproducible. Net: a real, fixable defect warranting prompt patching where Pillow processes attacker-influenced EPS filenames, but not a drop-everything internet-wide worm candidate given the AT:P preconditions and absence of KEV/EPSS signals.

Exploit ScenarioDerived

A web application lets users upload images and passes the uploaded file's attacker-controlled name directly to Pillow to open EPS input; Ghostscript is installed on the server. The attacker supplies a filename beginning with '@' that points to a text file they also control (e.g. another uploaded file), whose contents are injected as additional Ghostscript arguments, achieving command execution even under the default -dSAFER invocation. No public weaponized exploit was identified at time of analysis, though the vendor advisory documents a reproducing chain.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 19, 2026

Argument injection in Pillow's EPS decoding path (EpsImagePlugin.Ghostscript) lets a caller-controlled input filename be parsed as a Ghostscript option, and in the worst case escalates to arbitrary command execution. All Pillow releases from 2.6.0 up to but not including 13.0.0 are affected when Ghostscript is installed and the host application passes an unsanitized, attacker-influenced filename into Image.open() for EPS input; no authentication is required per the CVSS vector (PR:N), though exploitation depends on that application-level precondition. Making the path absolute before it is placed after Ghostscript's -f flag closes the issue, and the vendor shipped that change in 13.0.0 (commit a2c3631); no public exploit code or confirmed active exploitation was identified at time of analysis.

RemediationAI

Vendor-released patch: Pillow 13.0.0, which makes the EPS input path absolute (os.path.abspath) before it is passed to Ghostscript after -f; upgrade with 'pip install --upgrade Pillow>=13.0.0' and confirm the resolved version, since distro packages and pinned requirements frequently lag. If upgrading is blocked, add a pre-flight guard in the calling code: call os.path.realpath()/os.path.abspath() on any untrusted filename before opening it with Pillow, and reject or rename any basename starting with '-' or '@'. The cleanest compensating control is to copy untrusted uploads into a temporary directory under a server-generated name (for example a UUID plus a fixed extension) and open only that path, which removes the attacker's control over the leading character entirely at the cost of one extra file copy and temporary disk usage. Where EPS input is not a business requirement, deregister the plugin (PIL.EpsImagePlugin, and remove 'eps'/'ps' from the registered extensions) so Image.open() refuses EPS files outright, trading away EPS support for the attack surface. Removing or restricting Ghostscript from the application's PATH also breaks the chain but will cause EPS and PostScript loads to fail with an IOError, so audit callers first. Do not rely on -dSAFER as a mitigation: the reported exploit chain reproduces under the default safe invocation, and Ghostscript option processing happens before the sandbox takes effect. Note that plain argument injection only needs a filename starting with '-', while command execution additionally needs an '@' argument file whose contents the attacker controls, so review logging for EPS filenames beginning with '-' or '@' as a hunting signal. Advisory: https://github.com/python-pillow/Pillow/security/advisories/GHSA-w889-685w-c8fh.

Affected VersionsENISA

Pillow 2.6.0, < 13.0.0

Affected Packages

pypi pillow fix: 13.0.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Pillow's EPS support shells out to Ghostscript: EpsImagePlugin.Ghostscript() builds a subprocess command line ending in '-f' followed by fp.name, the raw filename string supplied by the caller. Because the value was passed through unchanged, a filename beginning with '-' was consumed by Ghostscript's own argument parser as an option rather than as a file operand, and a filename beginning with '@' was treated as an argument-file token, causing Ghostscript to read further options from an attacker-supplied text file. That is the classic CWE-78 pattern of untrusted data crossing into a command interpreter's option space; the practical consequence ranges from option injection (the regression test added alongside the fix uses the filename '-h' to confirm the help flag is no longer triggered) up to arbitrary command execution once an '@' argument file is under attacker control, and the reporter's chain works even against Ghostscript's default -dSAFER sandbox because the injected options are processed before the sandbox restricts file operations. The upstream fix is a single-line change wrapping the filename in os.path.abspath(), which guarantees the token begins with '/' and can never be read as an option or an @-file reference; the accompanying test test_filename_not_parsed_as_ghostscript_argument verifies the behavior. CPE data (cpe:2.3:a:python-pillow:pillow:*:*:*:*:*:*:*:*) covers the full 2.6.0 to 12.x range.

Know when Pillow gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 9.2 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
vuln.today AI 8.1 HIGH

AC:H because weaponized command execution requires an attacker-controlled @ argument-file and its contents; PR:N/UI:N as no auth or interaction is needed, and injected Ghostscript commands yield full C/I/A impact.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Oct 19, 2026 - 23:18 EUVD
CVE Published
Oct 19, 2026 - 22:07 cve.org
CRITICAL 9.2

DescriptionCVE.org

Pillow is a Python imaging library. From 2.6.0 until 13.0.0, Pillow is vulnerable to argument injection when invoking Ghostscript for EPS input. EpsImagePlugin.Ghostscript passes a caller-controlled input filename after -f without converting it to a safe absolute path, so a name beginning with a hyphen can be interpreted as a Ghostscript option. An attacker who controls the filename can inject Ghostscript arguments. Arbitrary command execution specifically requires a leading @ argument-file filename and control of the referenced text file containing additional Ghostscript arguments; the reported chain reproduces with the default -dSAFER invocation. This issue is fixed in version 13.0.0.

Technical POC Analysis

The flaw is CWE-88 argument injection in PIL.EpsImagePlugin.Ghostscript in src/PIL/EpsImagePlugin.py, with an optional chain to CWE-78 OS command injection.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

Pillow, the widely used Python imaging library, carries a critical argument-injection flaw (CVE-2026-112900) in its EPS decoding path that can escalate to arbitrary command execution on any host where Ghostscript is installed and an application passes an attacker-influenced filename into Image.open(). Products and internal services that accept user-supplied EPS images - customer upload endpoints, document-conversion pipelines, and CI/build jobs that render untrusted images - are the exposed surface, and successful exploitation yields code execution under the service account, meaning data theft, lateral movement, and service disruption. Leadership should care because remediation requires coordinated library upgrades across many teams plus verification that Ghostscript is present on those hosts, and the precondition (application-level filename handling) makes exposure hard to assess without a full dependency inventory.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.4%
Top 64% exploitable
Prevalence
High
Pillow is among the most widely deployed Python imaging libraries
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

More in Pillow

View all
CVE-2022-30595 CRITICAL POC
9.8 May 25

libImaging/TgaRleDecode.c in Pillow 9.1.0 has a heap buffer overflow in the processing of invalid TGA image files. Rated

CVE-2026-59204 HIGH POC
8.7 Jul 14

Denial of service in Python Pillow (versions 8.2.0 through 12.2.0) allows remote attackers to exhaust memory during JPEG

CVE-2026-54058 HIGH POC
8.3 Jul 14

Out-of-bounds memory disclosure in Python Pillow before 12.3.0 lets an attacker who supplies a crafted McIdas AREA image

CVE-2026-59197 HIGH POC
8.2 Jul 14

Heap out-of-bounds write in Python Pillow prior to 12.3.0 lets an attacker who controls the rank-filter size parameter c

CVE-2026-59200 HIGH POC
7.5 Jul 14

Uncontrolled memory consumption in Python Pillow (PIL) versions 5.1.0 through 12.2.x allows a remote attacker to cause d

CVE-2021-23437 HIGH POC
7.5 Sep 03

The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb

CVE-2025-48379 HIGH POC
7.1 Jul 01

Pillow is a Python imaging library. In versions 11.2.0 to before 11.3.0, there is a heap buffer overflow when writing a

CVE-2016-4009 CRITICAL
9.8 Apr 13

Integer overflow in the ImagingResampleHorizontal function in libImaging/Resample.c in Pillow before 3.1.1 allows remote

CVE-2014-3007 CRITICAL
10.0 Apr 27

Python Image Library (PIL) 1.1.7 and earlier and Pillow 2.3 might allow remote attackers to execute arbitrary commands v

CVE-2026-96639 CRITICAL
9.8 Oct 21

Pillow versions 11.0.0 through 12.x (fixed in 13.0.0) can reuse a stale native ImagingCore buffer when a multi-frame ima

CVE-2021-34552 CRITICAL
9.8 Jul 13

Pillow through 8.2.0 and PIL (aka Python Imaging Library) through 1.1.7 allow an attacker to pass controlled parameters

CVE-2021-25289 CRITICAL
9.8 Mar 19

An issue was discovered in Pillow before 8.1.1. Rated critical severity (CVSS 9.8), this vulnerability is remotely explo

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy