Threat feed

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)

  1. Crafted document escapes Ghostscript -dSAFER and spawns OS commands

    • T1190Exploit Public-Facing Application
    • T1059.004Command and Scripting Interpreter: Unix Shell

    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
  2. Escaped renderer reads and writes arbitrary host files

    • T1505.003Server Software Component: Web Shell
    • T1005Data from Local System

    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
  3. Anonymous IPP print job runs commands through CUPS as lp

    • T1190Exploit Public-Facing Application
    • T1059.004Command and Scripting Interpreter: Unix Shell

    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

Questions, detections or sightings of Upload2Shell Ghostscript sandbox escape RCE? Bring them to the community.