Pillow 13.0.0 fixes Ghostscript argument injection CVE-2026-112900; CVE record scores it 9.2, maintainers rate it Medium
Pillow 13.0.0, released on 16 October 2026, fixes GHSA-w889-685w-c8fh, tracked as CVE-2026-112900: a filename that starts with a hyphen or an at sign can inject arguments into Ghostscript when Pillow renders EPS input. Command execution additionally needs an at-sign filename and attacker control of the file it names. The CVE record scores it 9.2 under CVSS 4.0; Pillow's release notes list it as Medium.
By Parminder Kumar Sharma · LinkedIn · · 7 min read
Correction, 26 October 2026: the proof of concept, the day count, a release date and the severity wording were corrected
An audit on 26 October checked this briefing against Pillow's advisory and release notes. What changed: the earlier text said the proof of concept was withheld, but the advisory prints it; the day count is 4,398, not 4,386; Pillow 12.3.0 was released in July, not October; the advisory rates the flaw Moderate and the release notes say Medium, against the CNA's 9.2; and code execution needs a filename starting with an at sign plus attacker control of the file it names. The UK section was removed and the dead link replaced. The hero figure was replaced.
Twelve years in the EPS plugin, fixed in one line
For 4,398 days (derived from PyPI upload dates of 1 October 2014 and 16 October 2026), spanning twelve years and eleven major release trains, Pillow's EPS plugin passed a caller-controlled filename to Ghostscript without making it a safe path. The flaw is in PIL.EpsImagePlugin.Ghostscript(), which renders Encapsulated PostScript images. The advisory lists Pillow 2.6.0 through 12.3.0 as affected and 13.0.0 as patched. The CVE record (GitHub as CNA) gives CVSS 4.0 9.2 Critical, while the advisory page shows severity Moderate and Pillow's 13.0.0 release notes list the issue under Medium.
PyPI statistics show 436,470,920 Pillow downloads for the last month (pypistats.org, read 26 October 2026), about 14.5 million a day (derived). A download count does not show exposure. Per the advisory, an attacker needs Ghostscript on the host, EPS input processed from a file path, and an attacker-influenced filename reaching Image.open(). For command execution the CVE record adds that the filename must begin with an at sign and the attacker must control the text file it names. The advisory does not address exploitation in the wild; the CISA entry in the CVE record lists Exploitation as none on 20 October 2026.
What the vulnerability record establishes and what it leaves unstated
To evaluate the real operational risk to enterprise applications, developers and security engineers must distinguish the proven mechanics of CVE-2026-112900 from secondary alarmism.
Audit of verified technical claims in GHSA-w889-685w-c8fh versus unstated deployment assumptions
| Technical Dimension | Stated in the advisory, CVE record or release notes | Not Stated or Dependent on Environment |
|---|---|---|
| Vulnerable Code | PIL.EpsImagePlugin.Ghostscript() passes fp.name directly at -f [infile]. | Objects without a usable file name take the temporary file branch, which the advisory says needs no change. |
| Injection Tokens | Leading hyphens (-, --) parsed as options; leading @ parsed as an argument file. | Which host conditions let an attacker control the referenced file; the advisory says only that the attacker must control it. The advisory prints its own proof of concept, which this site does not repeat. |
| Sandbox Behaviour | Ghostscript's default -dSAFER sandbox does not prevent this argument-injection chain. | Whether strict OS-level container isolation (such as Docker seccomp or AppArmor profiles) halts the spawned process. |
| Exploitation State | The advisory does not address exploitation. The CISA entry in the CVE record lists Exploitation as none (20 October 2026). | Whether threat actors have historically exploited this vector during opportunistic web application scans. |
| Remediation | Upgrading to Pillow 13.0.0 resolves the issue by forcing os.path.abspath(). | Any workaround or backport for systems that cannot move to 13.0.0, which PyPI lists as requiring Python 3.11 or later; the release notes say Python 3.10 support was dropped. The advisory lists no workaround. |
The friendly-name fallacy: why -dSAFER failed to protect the host
When Pillow invokes Ghostscript it includes -dSAFER in the argument list. The advisory states that the injection reproduces with that default invocation, so the flag did not prevent it.
This site's inference: -dSAFER restricts what PostScript can do, and it does not govern how Ghostscript parses its own command line. The advisory states that a filename of the form at-sign plus a path makes Ghostscript read further command-line arguments from that path, and that if the attacker also controls the referenced file the result can be arbitrary command execution, which the reporter verified by running the id command.
As demonstrated in the technical diagram, the vulnerability exists entirely because subprocess.check_call was given an array whose elements contained unneutralised command-line prefixes. While using an array prevents traditional shell injection (such as semicolon chaining), it provides zero protection against argument injection when a helper binary interprets leading characters as flags or parameter files.
The one-line remediation in Pillow 13.0.0
The engineering solution implemented by Pillow maintainers in commit a2c363141da31a265dd536c945677db4b64f3ec9 is remarkably compact. Rather than attempting to maintain an exhaustive denylist of dangerous Ghostscript parameters, maintainers modified a single line of logic in src/PIL/EpsImagePlugin.py:
# Before (vulnerable in Pillow 2.6.0 through 12.3.0):
if hasattr(fp, "name") and os.path.exists(fp.name):
infile = fp.name
# After (fixed in Pillow 13.0.0):
if hasattr(fp, "name") and os.path.exists(fp.name):
# Make the path absolute so that a filename beginning with "-" or "@"
# can never be interpreted by Ghostscript's argument parser
# as an option or an @-file token
infile = os.path.abspath(fp.name)
By wrapping fp.name in os.path.abspath(), the resulting filename string is guaranteed to begin with a root directory separator (such as / on Linux and macOS, or C:\ on Windows). Because the path never begins with a hyphen or an @ symbol, Ghostscript's argument parser is forced to evaluate the token exclusively as a file path, neutralising the injection vector completely.
Defender checklist: hardening Python image processing pipelines
Take this with you
Ordered engineering actions to mitigate CVE-2026-112900 and image decoder risks
- Upgrade Pillow to 13.0.0 or later across all production virtual environments and container images. It requires Python 3.11 or later per PyPI, and the release notes list many other security fixes.
- Audit container base images and remove Ghostscript binaries unless EPS/PS rendering is explicitly required by business workflows.
- Inspect file upload endpoints to ensure user-supplied filenames are stripped and replaced with cryptographically random UUIDs before processing.
- Reject uploaded files whose names begin with hyphens, @ symbols, or non-alphanumeric characters at the API gateway layer.
- Pass image data to Pillow via in-memory byte streams (io.BytesIO) rather than passing raw filesystem paths where feasible.
- Enforce strict container sandboxing: execute worker processes as non-root users with read-only root filesystems and dropped capabilities.
- Run automated dependency scanners (such as pip-audit or Dependabot) in continuous integration pipelines to catch transitive Pillow versions.
The exposing question
When your application security team inspects user uploads by verifying file headers, MIME types, and magic bytes, how many backend services still hand the untrusted filename directly to an operating system binary that treats punctuation as code?
Key facts
Sources
- PrimaryPillow 13.0.0 release notes (2026-10-16), Security sectionPillow projectaccessed 2026-10-26
- PrimaryPillow on PyPI (release dates and Python requirement)Python Package Indexaccessed 2026-10-26
- Reported byPillow download statistics (last month figure)pypistats.orgaccessed 2026-10-26


