Ghostscript sandbox escape CVE-2026-125396 lets crafted file uploads run commands on servers, pwn.ai shows

· CyberSecurity

TLDR

  • Ghostscript before 10.08.0 has a sandbox bypass, CVE-2026-125396, that lets a crafted document run commands as the user rendering it.57
  • pwn.ai says it confirmed command execution in ten index entries, including Debian 13 CUPS and Roundcube.2
  • Artifex fixed it in Ghostscript 10.08.0 on 8 September; no exploitation in the wild has been reported.124

A flaw in Ghostscript lets a crafted file escape the interpreter's -dSAFER sandbox and run commands on the server that processes it, according to a write-up published on 21 November 2026 by the security firm pwn.ai.3 The Hacker News describes Ghostscript as the interpreter many Linux servers use to convert uploaded PDFs, PostScript files and images, often without the application calling it directly.1 pwn.ai says the flaw, now tracked as CVE-2026-125396, is a use-after-free in Ghostscript's Type 1 font loader, and that it was found by an AI model it names as GPT 5.6 Sol working with researcher Paulos Yibelo.3 The NVD record describes a -dSAFER bypass in the .putgstringcopy procedure that calls the privileged .forceput operator without checking operand types, and lists a CVSS 4.0 score of 8.5 (high) with a local attack vector, assigned by VulnCheck as the CNA.5 NVD had not yet provided its own assessment.5

pwn.ai says almost every application it tested with file uploads could be tricked into passing a file with a trusted extension to Ghostscript, because libraries such as ImageMagick and Pillow can hand PostScript content to it even when the file is named .png, .jpg or .pdf.3 In its tests, PHP GD, OpenCV, prebuilt Sharp, Jimp, Java ImageIO and Go's standard image decoders did not start Ghostscript.3 Its index records execution in ten entries, including an anonymous print job to a shared Debian 13 CUPS queue that ran a command as the lp user, a Roundcube 1.7.2 message whose attachment was thumbnailed when the recipient viewed it, and signed-out upload routes in the Forminator 1.55.1 and Essential Addons for Elementor Lite 6.7.0 WordPress plugins.2 For Roundcube it says the tested ImageMagick delegate was required, and for WordPress Core it lists the upload_files capability, which Authors and above have by default.2 The index labels other entries, such as InvokeAI, ComfyUI and Home Assistant Core, as source-mapped paths rather than confirmed exploitation.2 iTnews quotes a 21 November post by Yibelo saying they had remotely and reliably achieved remote code execution on 15 different applications and over 10 "bugb" servers, which iTnews does not expand.4 pwn.ai says Google fixed the affected path in its image and document processing on 10 November.2

pwn.ai dates its discovery of the flaw to 27 July 2026 and says Artifex received the report as Artifex Bug 709684 by 2 September.2 Artifex released Ghostscript 10.08.0 with the fix on 8 September.246 WordPress had shipped version 7.0.4 on 12 August, a separate security fix, CVE-2026-65640, for authenticated Author+ remote code execution via malicious file upload on sites that use Imagick and Ghostscript, and credits pwn.ai.8 iTnews reports that pwn.ai requested the CVE on 6 November and that it was published on 9 November US Eastern time, more than two months after the fix; NVD gives a published date of 9 November.45 On oss-security, Alan Coopersmith of Oracle wrote that the 10.08.0 release notes say only that the release addresses a number of potential security issues and by mistake carry the 10.07.0 release date, and that Ghostscript's CVE page lists five other CVEs as fixed in 10.08.0, with pwn.ai identifying CVE-2026-125396 as also fixed in it.6 The Hacker News and iTnews both report no attacks using the flaw.14 iTnews says pwn.ai published a working proof of concept alongside the disclosure and that it replicated the proof on an earlier Ghostscript version, while the 10.08.0 build did not trigger the flaw.4 The Hacker News says the one proof file described in the technical analysis shows only the core memory trick, changing a value inside the interpreter and setting it back without running a shell command, and that it fails on 10.08.0 before that point.1

Fix coverage varies by distribution. AlmaLinux says it was not aware of fixed Ghostscript packages for RHEL 8, 9 or 10, has put backported packages for AlmaLinux 8, 9 and 10 in its testing repository, and says Debian and Ubuntu have shipped the same backport.7 iTnews notes that the version number alone can mislead because distributions often backport fixes.4 The Hacker News, citing pwn.ai's package survey as of last week, lists Debian 12 as vulnerable, fixes pending for Amazon Linux and fixes in progress for several SUSE releases, and says the firm did not establish whether current Red Hat, Rocky Linux, AlmaLinux, Oracle Linux or stable Fedora packages carry the fix.1 The Hacker News and AlmaLinux both say a host update does not reach a copy of Ghostscript bundled in a container image or application.17 Until a system is patched, AlmaLinux suggests not sharing CUPS queues with untrusted networks, requiring authentication on them, and disabling the PostScript, EPS and PDF coders in ImageMagick's policy.xml where they are not needed, and says patching is the reliable fix.7

Why it matters: a file upload, print job or email preview can reach Ghostscript through other libraries, and AlmaLinux says copies bundled in containers are not fixed by updating the host.37

Sources

  1. Researchers Demonstrate Ghostscript Sandbox-Escape RCE via Crafted File Uploads in Popular Apps (The Hacker News)
  2. Upload2Shell · CVE-2026-125396 · pwn.ai research (pwn.ai)
  3. How We Hacked the Pipes: Upload2Shell (pwn.ai)
  4. AI-found Ghostscript flaw turned file uploads into remote code execution (iTnews)
  5. NVD-CVE-2026-125396 (NIST National Vulnerability Database)
  6. oss-security - Ghostscript 10.08.0 fixes multiple CVEs, including "upload2shell" (oss-security mailing list)
  7. Upload2Shell (CVE-2026-125396): Patched Ghostscript available in testing (AlmaLinux OS)
  8. WordPress 7.0.4 Release (WordPress.org)