A newly patched vulnerability in Ghostscript (CVE-2026-125396) allows attackers to escape its sandbox and execute code on Linux servers via crafted file uploads. The flaw was discovered by security researchers at pwn.ai and fixed in Ghostscript version 10.08.0 as of September 8, 2026. So far, there have been no confirmed cases of this exploit in the wild.
How the Exploit Works
Ghostscript is widely used server-side to render and convert uploaded documents—PDFs, PostScript files, even images—through various libraries like ImageMagick, libvips, Pillow, or Qt plugins. The danger comes when a file that appears benign (for example, a.png or.jpg) is actually crafted PostScript or EPS content. These files may be routed into Ghostscript even during simple operations like thumbnailing or cropping, in many standard applications.
The root issue is a use-after-free bug in Ghostscript’s font loading functionality. An attacker can use this to disable the -dSAFER sandbox mode, which is meant to prevent documents from running unauthorized commands or accessing host files. Once sandboxing is bypassed, arbitrary code execution becomes possible.
Real-World Attack Paths & Fix Status
Researchers tested the exploit across roughly ten common applications. In many cases, the exploit ran under a low-privilege user account, yet managed to execute commands via print jobs, email attachments processed by Roundcube webmail, and public upload forms used by popular WordPress plugins like Forminator and Essential Addons for Elementor.
In WordPress Core, the path is harder: uploading files requires an account with author-level privileges or higher. Although the issue is officially classified as a local flaw, several attack vectors enable access over the network—such as shared print queues or automated email file processing.
Not all systems are patched. Although the Ghostscript team addressed the bug (version 10.08.0), many Linux distributions still include vulnerable versions or have pending fixes. Debian 12 («Bookworm») is confirmed vulnerable. SUSE’s Enterprise and openSUSE Leap branches and several editions of Amazon Linux are among those with patch status pending or in progress.
App developers and system administrators are warned that simply updating the operating system isn’t enough if applications bundle their own Ghostscript copy. In such cases, an old version could remain operational even after the host OS is patched.
Mitigation Tips
Until all components are verified to use patched Ghostscript builds, administrators can take interim steps: enforce authentication for print services; only allow trusted file types; use safe system controls like AppArmor to confine Ghostscript’s operations; and audit application code paths that invoke image or document libraries.
Why this matters:Ghostscript is a legacy interpreter integral to many rendering workflows. When its sandbox is circumvented via seemingly harmless uploads, unprivileged attackers gain footholds on servers. Fixing CVE-2026-125396 closes one such gap—but gets messy in complex stacks where multiple subcomponents may still use older Ghostscript builds.
It’s essential for organizations to map which services invoke external rendering or imaging libraries, to track where Ghostscript is used directly or bundled, and to verify all layers are patched. Looking ahead: future vulnerabilities may follow similar patterns, exploiting riverbanks where security assumptions depend on external libraries. Vigilance now pays off.