Upload2Shell
Disclosed Nov 21, 2026
Updated Dec 2, 2026
A Ghostscript -dSAFER sandbox escape and use-after-free vulnerability allowing crafted PostScript or EPS documents disguised as PDFs or images to execute arbitrary OS commands when processed by upload handlers, thumbnailers, or print queues.
Component
Ghostscript PostScript Interpreter (.putgstringcopy / Type 1 Font Loader)
Attack Vector & Class
Sandbox Escape
Memory Safety
Exploitation Status
No confirmed wild attacks
Public PoC available
CVSS & Ecosystems
8.5 (v4.0)
Ghostscript, Linux, ImageMagick, CUPS
Affected Versions
- Artifex Ghostscript < 10.08.0 (and unpatched Linux distribution packages)
- Web applications, mail clients, and print queues (e.g., ImageMagick, Pillow, Roundcube, CUPS, WordPress plugins) invoking Ghostscript to render untrusted uploads
Fixed / Recommended Versions
- Artifex Ghostscript 10.08.0+
- Patched Linux distribution Ghostscript packages (AlmaLinux, RHEL, Debian, Ubuntu, SUSE)
Technical Root Cause
Patched upstream in Ghostscript 10.08.0 on September 8, 2026, assigned CVE-2026-125396 on November 9, and publicly detailed by pwn.ai on November 21, Upload2Shell exploits missing operand validation in the .putgstringcopy procedure inside gs_fonts.ps. By triggering a type error inside a custom error handler, an attacker recovers the privileged .forceput operator and leverages a use-after-free across save/restore in the Type 1 font loader to escape the -dSAFER sandbox. Researchers demonstrated remote command execution across 10 real-world applications and print pipelines that transitively invoke Ghostscript via ImageMagick, Pillow, or CUPS.
Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Remediation & Hardening
- 1Upgrade Ghostscript to 10.08.0 or apply your Linux distribution's patched ghostscript package across all hosts and container images.
- 2Restrict Ghostscript delegates (PS, EPS, PDF, XPS) in ImageMagick's policy.xml where document rendering is unnecessary.
- 3Update downstream web applications such as Roundcube (1.6.20+) and WordPress (6.8.8 / 6.9.7 / 7.0.4+) and audit print queues (CUPS) for anonymous access.