Ghostscript Flaw Lets a Crafted Upload Run Commands on Your Server: Patch the Renderer, Not Just the Host
Security firm pwn.ai has shown that a flaw in Ghostscript, the interpreter many Linux servers use to convert PDFs, PostScript files and images, can let a crafted file break out of its sandbox and run commands on the server. The bug, tracked as CVE-2026-125396 and scored 8.5 out of 10, was fixed on September 8 in Ghostscript 10.08.0. There are no reports of it being used in attacks.
The risk is wide because applications often reach Ghostscript indirectly. Libraries such as ImageMagick, Pillow, libvips or a Qt plugin can pass PostScript or EPS content to it even when the file is named .png, .jpg or .pdf. Something as routine as making a thumbnail can start the interpreter. The underlying bug is a use-after-free in font loading, which a crafted document uses to switch off the -dSAFER sandbox checks.
The researchers ran such a document through about ten applications and each time a command ran as the low-privilege rendering account. Several paths needed no login: an anonymous print job to a shared Debian 13 queue, an email attachment processed by Roundcube when the message was opened, and public upload forms in the WordPress plugins Forminator and Essential Addons for Elementor. WordPress Core needed an account able to upload files, which Authors and above have by default. Although the CVE is classed as local, these tests reached it over the network.
Patching needs care. Updating the host does not update a separate Ghostscript bundled in a container image or application, so a document worker may keep running old code. Several Linux distributions still shipped a vulnerable version or had a fix pending, and the firm did not establish the status of current Red Hat, Rocky, AlmaLinux, Oracle Linux or stable Fedora packages. WordPress 7.0.4 closed its own upload path under CVE-2026-65640, but that covers a different point in the chain, so both fixes matter.
Why it matters
The assumption broken here is that a file named .png or .jpg is only an image and that the sandbox contains anything inside it; a crafted file can disable that sandbox through libraries your own code never calls directly. Anyone running upload forms, webmail, shared print queues or document workers is exposed, and a host package update may not fix it if Ghostscript is bundled in a container or application. It also means the 'local' label on the CVE understates real exposure, since the tests reached it from the network.
What to do
- Update Ghostscript to version 10.08.0 or a distribution build that includes the fix.
- Check container images and applications for bundled Ghostscript copies and rebuild them, since host updates do not cover these.
- Require authentication on print queues and limit which file types image processors accept.
- Update WordPress to 7.0.4 or later, and apply an AppArmor profile to stop the renderer starting a shell.