Upload2Shell Ghostscript sandbox escape RCE
Upload2Shell: Ghostscript -dSAFER sandbox escape turns untrusted file uploads into OS command execution across web, mail, and CUPS print stacks
Posted · Spectrum Delta Research Team
Summary
Unattributed research by Paulos Yibelo at pwn.ai (B/2) shows a use-after-free in Ghostscript's Type 1 font loader, CVE-2026-125396, escaping the -dSAFER sandbox to run operating-system commands when a crafted PostScript, EPS, or PDF file, including payloads disguised as PNG or JPEG images, reaches Ghostscript before 10.08.0 through upload, thumbnail, email, or print pipelines. The evidence index was updated on 18 November 2026 with a native-write proof of concept and rolling remote-execution proofs from Debian 13 CUPS; the CVE was published on 9 November 2026, and Ghostscript 10.08.0, Ubuntu and Debian builds fix it while Amazon Linux, SUSE and Azure Linux fixes remain pending. Command execution as the web or print user is demonstrated across ten applications including WordPress, Roundcube, MediaWiki, DokuWiki, Mayan EDMS, ResourceSpace and Plesk Obsidian, plus a bounded production file read at Google mitigated on 10 November 2026, and traced Gradio and Paperless-ngx exposure. No in-the-wild exploitation is confirmed as of 21 November 2026; the published proof of concept raises mass-exploitation risk for unpatched hosts and containers.
Breakdown
Technical exposure
- Hosts and containers running Ghostscript before 10.08.0
- Untrusted files reach gs or libgs via upload, thumbnail, or mail pipelines
- ImageMagick, Imagick, Pillow, libvips, Qt, or gstopdf invoking Ghostscript
- Shared CUPS queue accepting anonymous IPP Print-Job on TCP/631
- No AppArmor or seccomp containment around the renderer process
Adversary
Unattributed · research disclosure by Paulos Yibelo at pwn.ai (B/2); no threat actor observed exploiting it in the wild as of 21 November 2026
Procedures (3)
Crafted document escapes Ghostscript -dSAFER and spawns OS commands
Logs
auditd · Syscall execve with PROCTITLE: gs or ghostscript, or an in-process libgs host worker (php-fpm, apache2, python3) spawning /bin/sh -c or unexpected child binaries as lp, www-data, roundcube_sysuser, or the worker UID
Sysmon for Linux process events · EventID 1 ProcessCreate: gs or ghostscript, or a libgs host worker, spawning sh, interpreters, or unexpected executables; parent command line containing -dSAFER
- eBPF runtime telemetry · Process spawned by gs, ghostscript, or a web/print worker: shell or interpreter child outside expected spool or render paths
Detectors
- Splunk Security Content · Linux Ghostscript Exploitation (580f99d8-a4c8-4ef1-9c84-f355867bca41)Not built-in
Escaped renderer reads and writes arbitrary host files
Logs
auditd · File openat, creat or write: renderer or web worker (www-data, lp, roundcube_sysuser) writing PHP, shell, Python, or ELF files into webroots or /var/tmp, or reading /proc/version, /etc/shadow, or cloud credential paths
- eBPF runtime telemetry · File open or create: web or print worker writing executable or script files outside expected spool, temp, and cache paths
Anonymous IPP print job runs commands through CUPS as lp
Logs
CUPS logs · access_log or error_log: unauthenticated IPP Print-Job operation on TCP/631 to a shared queue, followed by gstopdf and gs -dSAFER execution (corroborator)
auditd · Syscall execve: shell or unexpected child of gstopdf or gs running as uid=7 (lp)
Detectors
- Elastic Security prebuilt rule · Printer User (lp) Shell Execution
Indicators of compromise
CVEs (3)
- CVE-2026-125396Ghostscript Type 1 font loader use-after-free; -dSAFER escape to OS command execution, fixed upstream in 10.08.0
- CVE-2026-65640WordPress Core upload path to Ghostscript RCE, fixed in 7.0.4 and 6.9.7
- CVE-2026-114727Roundcube restricted unsafe attachment image types before ImageMagick conversion, 19 October 2026
Sources
- B/2pwn.ai: Upload2Shell Research Paper
- B/2pwn.ai: Upload2Shell Evidence Index
- A/1CVE Program: CVE-2026-125396 record
- A/1ArtifexSoftware: ghostpdl fix commit 1484854
- A/1WordPress: GHSA-8vr3-7mxf-gx8w advisory
- A/1Ubuntu: USN-8949-1 ghostscript update
- A/1Debian Security Tracker: ghostscript
- A/2Microsoft: MSRC CSAF VEX for CVE-2026-125396
- A/3Splunk Security Content: Linux Ghostscript Exploitation rule
- A/3Elastic Security: Printer User (lp) Shell Execution prebuilt rule
- B/3Falco: Default rules reference
Grades are source reliability (A–F) and information credibility (1–6).
Questions, detections or sightings of Upload2Shell Ghostscript sandbox escape RCE? Bring them to the community.