Upload2Shell CVE-2026-125396: Ghostscript sandbox escape from file uploads, what to check and fix
A use-after-free in Ghostscript's font loader lets a crafted document run commands, and many upload, email and print features reach Ghostscript without calling it.
· 7 min read
Written by AI from the sources linked below. How we use AI
On this page
A crafted document can escape Ghostscript's -dSAFER sandbox and run commands as the rendering process, and a surprising number of ordinary upload, thumbnail and print features hand untrusted files to Ghostscript without the developer ever calling it. The flaw is tracked as CVE-2026-125396 and nicknamed Upload2Shell by the researchers at pwn.ai who published their write-up on 21 November 2026. The upstream fix has been out since Ghostscript 10.08.0, but distribution and container updates are uneven, so the real question for most teams is whether an old copy is still hiding in a server, an image or an app bundle.
Key points
- CVE-2026-125396 is a use-after-free in Ghostscript's Type 1 font loader that lets a crafted PostScript or PDF document bypass
-dSAFERand execute commands (Debian security tracker, pwn.ai). - Ghostscript 10.08.0 contains the fix; pwn.ai and freenode give 8 September 2026 as its release date.
- pwn.ai reports working proofs against Debian 13 CUPS, Roundcube, WordPress with the Forminator and Essential Addons for Elementor plugins, MediaWiki, DokuWiki, Mayan EDMS and ResourceSpace, among others.
- pwn.ai rates it 8.5 under CVSS 4.0 with a local attack vector, even though its demonstrations delivered the file remotely.
- WordPress shipped its own fix on 12 August 2026 in version 7.0.4 (CVE-2026-65640).
What to do
Who is affected. Any system where an untrusted file can reach a Ghostscript older than 10.08.0: web apps that make thumbnails or previews, mail servers that render attachments, print servers, document pipelines and AI image tools. Ghostscript is often present as a dependency of ImageMagick or Pillow rather than something you installed on purpose.
How to get the fix.
- Upgrade to Ghostscript 10.08.0 or newer, or to your vendor's patched package.
- Debian: the Debian security tracker lists bookworm as fixed in
10.0.0~dfsg-11+deb12u9(DLA-4914-1) and trixie as fixed in10.05.1~dfsg-1+deb13u3(DSA-6516-1 covered the earlierdeb13u2build). - Ubuntu: notice USN-8949-1, published 21 October 2026, lists
10.07.1~dfsg-1ubuntu2.1for 26.10,10.06.0~dfsg-3ubuntu1.2for 26.04 LTS and10.02.1~dfsg1-0ubuntu7.10for 24.04 LTS, with further builds for older releases. The notice describes the font-loading sandbox bypass without a CVE number. - WordPress: update to 7.0.4 or 6.9.7 or a later release (the versions pwn.ai lists as fixed for CVE-2026-65640).
- Amazon Linux and SUSE: RuntimeWire reported on 21 November that Amazon's tracker still showed "Pending Fix" for the package. Trackers change quickly, so check the vendor's page yourself.
How to check if you are affected. Run gs --version on every host that processes uploads, then look inside containers and bundled applications, because updating the host does not update a Ghostscript copy baked into an image. On Debian-family systems dpkg -l ghostscript libgs10 shows the installed build to compare with the versions above.
If you cannot patch yet. pwn.ai says requiring authentication on a shared CUPS queue stopped the anonymous print-job route it used. Beyond that, the usual hardening applies: do not let anonymous visitors upload PostScript, EPS or PDF files into pipelines that render them, and consider disabling Ghostscript-backed coders in ImageMagick's policy file. We have not tested those steps, and pwn.ai notes that some routes, such as Pillow's EPS decoder, bypass ImageMagick entirely.
What happened
pwn.ai's researchers say they found the flaw on 27 July 2026 and a signed-out request reached Ghostscript inside Google's document renderer by 30 July. They credit the discovery to the model "GPT 5.6 Sol" working with researcher Paulos Yibelo, which is their claim; we could not verify it independently. WordPress shipped a separate fix for its upload path on 12 August. The researchers filed the root cause with Artifex (Ghostscript's maintainer) as bug 709684 by 2 September, and Ghostscript 10.08.0 followed on 8 September.
Downstream fixes then trickled out: Debian's first stable-security update on 25 September and a further build on 10 October, Roundcube's image-resizing hardening on 19 October (CVE-2026-114727), and Ubuntu's notice on 21 October. The researchers requested a CVE on 6 November, it was published on 9 November, Google mitigated its production path on 10 November, and the full technical write-up appeared on 21 November.
One detail is confusing. Ghostscript's own news page shows 10.08.0 with the date 2026-05-19. The freenode site says the release notes still carry another version's date by mistake, and both freenode and pwn.ai give 8 September. We could not resolve this from the project's pages, so we use 8 September and flag the discrepancy.
Background
Ghostscript renders PostScript and PDF. PostScript is a programming language, so rendering a document means running a program. The -dSAFER option restricts what that program may do with files and commands, but as pwn.ai explains, the enforcement lives inside the interpreter rather than in a kernel filter. A memory-safety bug in the interpreter can therefore undo it.
The wider research context is pwn.ai's earlier ImageMagick work, which showed that a file named .png or .jpg can still be handed to Ghostscript by content sniffing. Upload2Shell adds a working exploit at the far end of that chain.
How it works
According to pwn.ai, the bug sits in .putgstringcopy, a helper in Resource/Init/gs_fonts.ps that needs to write into protected font dictionaries and therefore calls the privileged .forceput operator. The Debian tracker's description matches: the helper does not check operand types. A malicious Type 1 font replaces a string on the operand stack with an array, so a later copy raises a typecheck error. The document's own error handler catches it, discards the leftover values and resumes execution at .forceput with attacker-chosen arguments.
That gives a protected write. Combined with Ghostscript's save and restore of local memory, it creates a global dictionary entry pointing at a freed local object: the use-after-free. Reusing the freed allocation lets the document read and write interpreter memory, and in the researchers' proof they cleared the flag that enforces native path control and changed the file-permission settings. A %pipe% file open then ran a shell command. The researchers say the command ran as the rendering process's account, such as lp on a CUPS server or www-data on a web server.
The more important lesson is reachability. In their tests the researchers traced 145 benign calls across 29 image APIs on Ubuntu 24.04 with Ghostscript installed. They report that these calls reached Ghostscript when given EPS content, even under a .png name:
| Library or call | Reached Ghostscript? |
|---|---|
Pillow 13.0.0 Image.load(), crop(), thumbnail() |
Yes, directly |
imageio / scikit-image imread() |
Yes, through Pillow |
PHP Imagick readImage() with ImageMagick 6.9.12-98 |
Yes |
| libvips (this build) via ImageMagick | Yes, build dependent |
| Qt KImageFormats with the EPS plugin | Yes, plugin dependent |
| PHP GD, OpenCV, prebuilt Sharp, Jimp, Java ImageIO, Go standard decoders | No, for these inputs |
Pillow's Image.open() alone only identified the file; it was loading or transforming pixels that started the renderer.
What it means
For operators of upload-heavy sites, the practical risk is the conditions around the bug. pwn.ai's table is specific about them: Roundcube needed a permissive ImageMagick delegate and an authenticated recipient viewing the message; the WordPress core route needed an Author-level account, while the Forminator and Elementor add-on routes worked for signed-out visitors on suitably configured sites; MediaWiki and DokuWiki needed anonymous uploads to be enabled; the CUPS route needed a shared queue accepting unauthenticated jobs. Most of these are not default configurations everywhere, which matters for how worried to be.
For developers, the lesson is that "we only accept images" is not a control when a decoder identifies files by content. Validate by decoding with a library that cannot reach an interpreter, or run conversion in a sandbox that does not depend on the interpreter's own checks.
There is also a disclosure debate. freenode quotes Jan Schaumann arguing that the flaw should be treated as public from the 8 September Ghostscript release, and that coordination "leaves much to be desired". freenode also quotes his suspicion that publicity for AI-driven vulnerability discovery is driving coverage. Those are opinions; the dates above are the evidence.
What we don't know yet
- How many real-world servers are exposed. The researchers' proofs are lab setups on pinned versions, and the exposure depends on configuration.
- Whether anyone exploited it before the patch. We found no report of in-the-wild exploitation.
- Vendor status. Amazon Linux and SUSE were reported as pending on 21 November, and several of pwn.ai's individual case studies ("not yet published") have not appeared.
- The researchers say other independent Ghostscript findings exist and "some of those bugs are still being fixed".
What to watch next
Expect the product-specific write-ups pwn.ai says it will link as they appear, further downstream advisories from distributions, and updates to plugins such as Forminator and Essential Addons for Elementor. Check your vendor tracker for CVE-2026-125396 and re-test containers after rebuilding them.
Sources
- pwn.ai: Upload2Shell, CVE-2026-125396 (primary)
- pwn.ai technical write-up, "How We Hacked the Pipes"
- Debian security tracker, CVE-2026-125396
- Ubuntu USN-8949-1: Ghostscript vulnerabilities
- WordPress 7.0.4 release announcement
- Ghostscript news and release notes
- freenode: Ghostscript 10.08.0 fixed upload2shell months before public writeup
- RuntimeWire: Amazon Linux still lists no fix
Written by
The official account of the people who run audiotale.net: announcements, conversation starters and the newsroom's drafts. Posts written with AI say so. Every other account here is a real person.
Read next
Ubuntu Pro Edge archive ships AI-written CVE fixes from Canonical's Surge
Canonical's opt-in Edge archive gives Ubuntu Pro users patches from its multi-agent Surge framework before full testing; stable security updates stay human-validated.
audiotale.net team6 min read
Anthropic cuts bug disclosure window to 30 days for high and critical flaws
From 1 January 2027, Anthropic will publish high and critical vulnerabilities its Claude models find in open-source software after 30 days instead of 90, citing faster fixes and bug rediscovery.
audiotale.net team7 min read
CVE-2026-99288 NoisyTCP: remote Linux kernel crash via TCP race, fixed in Debian kernels
An 11-year-old race in Linux TCP socket lookup lets an unauthenticated attacker panic a multi-queue server, public proof-of-concept code exists, and patches are rolling out.
audiotale.net team6 min read