Vulnerabilities

Upload2Shell: Ghostscript bug turns uploads and print jobs into shells

Ghostscript CVE-2026-125396 escapes the -dSAFER sandbox via print queues, webmail and WordPress uploads. Fixed in 10.08.0, but distro patching lags.

Illustration of a software bug inside a document pipeline representing the Ghostscript Upload2Shell vulnerability

A single Ghostscript bug, CVE-2026-125396, has been shown to give attackers command execution through print queues, webmail thumbnails and public WordPress upload forms. The upstream fix shipped in September, but patching is patchy across Linux distributions and anything that bundles its own copy of the interpreter.

What happened

Offensive security firm pwn.ai has published the full results of its Upload2Shell research, which centres on CVE-2026-125396, a flaw in Ghostscript, the PostScript and PDF interpreter maintained by Artifex Software. The researchers, with credit also going to Paulos Yibelo and Artifex’s Ken Sharp, found a way for a crafted document to break out of the interpreter’s -dSAFER sandbox and run commands with the privileges of whatever process is doing the rendering.

The bug itself is not new. pwn.ai found it on 27 July, reported it upstream as Artifex bug 709684, and Artifex shipped a corrected release, 10.08.0, on 8 September. What changed this month is visibility. The CVE identifier was only published on 9 November, VulnCheck’s advisory rates it 8.5 under CVSS 4.0, and the detailed technical write-up and impact index, last updated on 18 November, landed in the past few days, with The Hacker News covering it on 22 November.

The impact index is what makes this worth attention. pwn.ai says it reproduced command execution through around ten real applications. Several needed no account at all: an anonymous print job sent to a shared CUPS queue on Debian 13, an email attachment thumbnailed in Roundcube (including the build shipped with Plesk Obsidian) simply when the message was viewed, public upload fields in the Forminator and Essential Addons for Elementor WordPress plugins, and anonymous uploads on suitably configured MediaWiki and DokuWiki sites. WordPress Core itself was reachable by any user allowed to upload media, which by default means Authors and above. Nobody has reported exploitation in the wild. pwn.ai’s own proof of concept stops at memory corruption, but an unverified third-party GitHub exploit claiming full command execution has since appeared.

The technical picture

At heart this is a use-after-free in the PostScript code Ghostscript uses to load Type 1 fonts. Red Hat’s tracker and VulnCheck describe a helper procedure that calls a privileged internal operator without first validating what it has been given. A malicious document can provoke an error at the wrong moment, recover access to that privileged operator, and use it to dismantle the sandbox that is supposed to stop documents touching the file system or launching programs.

Artifex’s first fix adds the missing operand checks, and a follow-up change rewrites the helper in C so it no longer leans on the privileged operator at all. Ken Sharp described the vulnerable step as an old, well-known weak spot that has proved hard to remove.

The more important lesson is about reach. The CVE is formally scored as a local attack because Ghostscript processes a file it is handed. In practice, very little hands Ghostscript files by hand. Image libraries such as ImageMagick, Pillow and libvips, plus document preview and print filters, pass content to it automatically, and pwn.ai notes that a file named .png or .jpg can still end up there if its contents are really PostScript or EPS. A “local” bug in the renderer becomes a network bug the moment an application accepts a file from a stranger and generates a thumbnail.

Timeline of the Upload2Shell Ghostscript flaw from discovery on 27 July to uneven Linux distribution patching in November 2026

Why it matters for UK organisations

Ghostscript is one of those components almost nobody chooses deliberately and almost everybody runs. In the UK that means shared hosting platforms built on Plesk, WordPress estates at charities, councils, schools and small businesses, Roundcube webmail offered by hosting providers, university wikis, document management systems in professional services firms, and office print servers.

Distribution coverage is uneven. According to pwn.ai’s survey, on 12 November Debian’s tracker still showed Bookworm (Debian 12) as vulnerable, Amazon Linux 2, 2023 and the 2027 preview showed fixes pending, and several SUSE and openSUSE branches were affected or in progress. Whether the Red Hat family and stable Fedora carry this particular fix was not established. Ubuntu, by contrast, shipped fixes across seven releases in October, and Debian 13 is patched.

Containers are the trap. Updating the host package does nothing for a Ghostscript copy baked into an application image or bundled with a product. A document worker can keep running vulnerable code long after the server it sits on looks clean in a patch report.

Expert view

In my experience, file upload features are among the most consistently under-tested parts of a web application. Scoping conversations focus on authentication, injection and access control, while the thumbnail generator is treated as plumbing. When we test upload functions, the question that usually matters most is not whether the file is stored safely, but what processes it afterwards and with what privileges.

Upload2Shell is a clean illustration of that. The vulnerable code belongs to one project, the exposure belongs to dozens of others, and responsibility for fixing it is split between Artifex, distribution maintainers, plugin authors and whoever builds the container image. That fragmentation is why I would not take “we updated last month” as an answer here. Ghostscript has had other CVEs this year, and a patch for one does not prove this one is covered.

Nor is “no exploitation reported” much comfort. With the fix public since September, the research out and exploit code already circulating, sandbox escapes like this tend to be weaponised quickly.

What to do now

  1. Find every Ghostscript. Inventory hosts, container images and appliances, including copies bundled inside applications, not just the system package.
  2. Patch to 10.08.0 or a confirmed backport. Check the vendor tracker for CVE-2026-125396 specifically. On Debian 12, Amazon Linux and affected SUSE branches, track the advisory and apply compensating controls until a fixed package lands. This maps to the Cyber Essentials security update management control.
  3. Rebuild images. Rebuild and redeploy containers and document workers after base images are updated; restarting is not enough.
  4. Update the applications too. WordPress 7.0.4 (released 12 August, with backports) closed its own upload route under CVE-2026-65640, and Roundcube restricted risky attachment image types under CVE-2026-114727. Both layers need fixing.
  5. Shrink the attack surface. Require authentication on network print queues, disable PostScript, EPS and PDF handling in image libraries where it is not needed, and review public upload fields in WordPress forms. This sits under the Cyber Essentials secure configuration control.
  6. Contain the renderer. Run thumbnailing and conversion as a low-privilege account in an isolated worker. pwn.ai reports an AppArmor profile stopped a compromised interpreter from starting a shell in one test.
  7. Watch for signs. Alert on web, mail and print service accounts such as www-data or lp spawning shells or unexpected child processes.

Bottom line

CVE-2026-125396 has been fixable for more than two months, but the research now public shows how far one interpreter bug can travel through ordinary features like previews, print jobs and form uploads. Treat Ghostscript as an internet-facing component wherever your applications accept files, confirm the specific fix is present in every copy you run, and isolate the renderer so the next sandbox escape lands somewhere it cannot do much harm.

Sources