
Non-destructive proof of concept for CVE-2026-112900, demonstrating Ghostscript argument injection in Pillow's EPS rendering path with isolated Docker/Podman vulnerable-vs-patched comparison.
Language: English · Leia em Português (Brasil)
A reproducible, non-destructive proof of concept for the argument-injection vulnerability (CWE-88) in Pillow's EPS rendering path when invoking Ghostscript. The project compares a vulnerable Pillow release with the first fixed release, supplies an isolated Docker/Podman environment, and includes automated unit tests and technical documentation.
Important scope limitation: This PoC passes only Ghostscript's
-h(help) option as a specially named EPS file. It demonstrates argument injection, not arbitrary command execution (RCE). It does not include an RCE payload, an@argument-file payload, any network exploit, or code to attack a remote application. The upstream advisory discusses additional conditions under which RCE is possible.
| Item | Details |
|---|---|
| CVE | CVE-2026-112900 |
| GitHub Security Advisory | GHSA-w889-685w-c8fh |
| Affected software | Pillow (Python Imaging Library fork) |
| Affected versions | >= 2.6.0 and < 13.0.0 |
| First fixed version | 13.0.0 |
| Relevant function | PIL.EpsImagePlugin.Ghostscript() |
| Weakness | CWE-88 (argument injection); the advisory also describes a conditional CWE-78 chain |
| Safe demonstration | Relative EPS filename -h triggers Ghostscript help on affected versions |
| Default container image | Ubuntu 24.04 + Ghostscript + selected Pillow version |
Sources: Pillow's official security advisory and the GitHub Advisory Database.
Pillow supports reading EPS (Encapsulated PostScript) files using PIL.EpsImagePlugin. When an EPS image is rendered, Pillow calls Ghostscript to process the image.
In affected versions, the file name is passed to Ghostscript as an argument following -f, without first making the file path unambiguously a path. If the relative file name begins with -, Ghostscript may interpret it as an option instead of the intended EPS input filename.
This demo creates a valid EPS file literally named -h, opens it with Pillow using that relative name, and invokes load(). If Ghostscript prints its help text, that is observable evidence that the name was processed as a command-line option.
Application calls Image.open("-h") and image.load()
|
v
Pillow 12.3.0 forwards the relative filename to Ghostscript
|
v
Ghostscript parses "-h" as the help option
|
v
Result: VULNERABLE (argument injection observed, NOT RCE)
The fixed version normalizes the relevant file path before passing it to Ghostscript. See technical analysis for the affected code path, prerequisites, and mitigation guidance.
This repository intentionally provides a build argument that installs Pillow 12.3.0, a known vulnerable version. Do not use the vulnerable image for production, public services, or processing untrusted files.
Run these commands from the repository root (the directory containing Dockerfile). First build the intentionally vulnerable image:
podman build -t pillow-ghsa:vulnerable \
--build-arg PILLOW_VERSION=12.3.0 .
Run the safe demonstration with networking disabled, a read-only root filesystem, dropped capabilities, and a private writable temporary directory:
podman run --rm --network none \
--read-only --cap-drop all \
--security-opt no-new-privileges \
--tmpfs /tmp:rw,nosuid,nodev,noexec,size=32m \
pillow-ghsa:vulnerable
You should see Result: VULNERABLE when the help-option injection is reproduced.
Now build Pillow 13.0.0, the first fixed release:
podman build -t pillow-ghsa:patched \
--build-arg PILLOW_VERSION=13.0.0 .
And run the same test under the same container restrictions:
podman run --rm --network none \
--read-only --cap-drop all \
--security-opt no-new-privileges \
--tmpfs /tmp:rw,nosuid,nodev,noexec,size=32m \
pillow-ghsa:patched
You should see Result: NOT_REPRODUCED if the EPS renders without Ghostscript treating -h as an option.
Why compare two versions? The version contrast makes the observation more meaningful: the same benign file, tool invocation, and runtime configuration are used, while the Pillow version changes. It still does not constitute a security audit of your host or web service.
Replace podman with docker in the four commands above. The syntax of the build arguments and most isolation flags is the same.
Pass the following flags after the image name:
podman run --rm --network none \
--read-only --cap-drop all \
--security-opt no-new-privileges \
--tmpfs /tmp:rw,nosuid,nodev,noexec,size=32m \
pillow-ghsa:vulnerable python /app/poc.py --verbose
podman run --rm --network none \
--read-only --cap-drop all \
--security-opt no-new-privileges \
--tmpfs /tmp:rw,nosuid,nodev,noexec,size=32m \
pillow-ghsa:vulnerable python /app/poc.py --json
--verbose displays a truncated copy of captured Ghostscript output. --json provides structured data, including the detection status, runtime versions, and observed subprocess output.
Expected example on a vulnerable Pillow version:
Pillow / Ghostscript argument-injection laboratory
Advisory: GHSA-w889-685w-c8fh | CVE: CVE-2026-112900
Pillow: 12.3.0
Ghostscript: 10.x.x
Payload: -h (Ghostscript help; harmless argument injection)
Result: VULNERABLE
Details: Ghostscript interpreted '-h' as its help option: argument injection was reproduced. This does NOT demonstrate RCE.
Expected example with the fixed Pillow version:
Pillow / Ghostscript argument-injection laboratory
Advisory: GHSA-w889-685w-c8fh | CVE: CVE-2026-112900
Pillow: 13.0.0
Ghostscript: 10.x.x
Payload: -h (Ghostscript help; harmless argument injection)
Result: NOT_REPRODUCED
Details: EPS loaded without triggering Ghostscript help. This is consistent with a patched implementation; it is not a complete security audit.
The Ghostscript version will depend on the image build and may differ from the examples.