Events Securing Finance in the Age of AI · Secure.com X ZIG Finance · London, 12 Nov Register now

Upload2Shell Vulnerability Turns a Fake JPG Into a Shell on Your Server

Upload2Shell vulnerability lets a fake image escape Ghostscript's sandbox and run commands on WordPress, Roundcube and CUPS servers.

Upload2Shell vulnerability: an image file escaping a cracked sandbox toward a server

Upload2Shell Vulnerability Turns a Fake JPG Into a Shell on Your Server

  • Who should care: Anyone exposed to the Upload2Shell vulnerability, meaning teams running WordPress, Roundcube, CUPS print servers, or any app that builds previews and thumbnails from uploaded files.
  • What could go wrong: A file posing as a photo runs commands on your server the moment your app tries to preview it.
  • Do this: Move to Ghostscript 10.08.0 or a vendor build that names the fix, then rebuild every container image that bundles it.
  • Worth remembering: The CVE score calls this a local attack, yet researchers delivered it by email, upload, and print job.

A Ghostscript fix that shipped in September now has a name, a CVE, and public exploit code. The Upload2Shell vulnerability lets a booby-trapped document break out of Ghostscript’s sandbox, even on servers that never call Ghostscript directly.

What Happened?

On November 21, researchers at pwn.ai published full details and proof-of-concept code for CVE-2026-125396, a use-after-free bug in Ghostscript’s Type 1 font loader. In short, a crafted PostScript file renamed to .jpg, .png, or .pdf trips an error in the loader, gains read and write access to the renderer’s memory, and switches off the SAFER sandbox.

Artifex patched the Upload2Shell vulnerability in Ghostscript 10.08.0 on September 8, but the release notes mentioned it only as one of several potential security issues. Then, on November 9, the CVE record followed with a CVSS 4.0 score of 8.5.

Upload2Shell vulnerability attack chain: a fake JPG passes through ImageMagick or CUPS to Ghostscript and ends in a shell

Three Ways In

  • WordPress: A user with upload rights adds a fake image, and the PDF preview runs it through Imagick. WordPress 7.0.4 and 6.9.7 close that route.
  • Roundcube 1.7.2: Simply opening a crafted email builds a thumbnail and fires the exploit.
  • CUPS on Debian 13: One unauthenticated print job sent to a shared queue is enough.

In addition, the same trick reached MediaWiki, DokuWiki, Paperless-ngx, and several AI image tools. On WordPress sites with public upload forms, such as some Forminator and Essential Addons for Elementor setups, signed-out visitors could also trigger it.

What’s the Impact of the Upload2Shell Vulnerability?

Commands run as whatever account renders the file, such as www-data on a web server or lp on a print server. As a result, an attacker can drop a web shell, read config secrets, and move sideways through the network.

Storing a file is harmless. Previewing, resizing, converting, or printing it is not. For this reason, the flaw is easy to miss: the risky step happens in a background job, not during the upload itself.

The Patch Gap

As of November 12, Debian 12, Amazon Linux 2 and 2023, SUSE, and openSUSE Leap 16 still listed affected or pending packages. Meanwhile, Ubuntu shipped fixes on October 21, and Debian 13 also has a fix.

CISA had not added the flaw to its Known Exploited Vulnerabilities catalog as of November 20, and nobody has confirmed attacks in the wild. However, with working exploit code now public, that window is closing.

Ghostscript patch status for CVE-2026-125396 across Ubuntu, Debian, Amazon Linux, SUSE and openSUSE

How to Protect Your Servers From the Upload2Shell Vulnerability

  • Patch Ghostscript: Upgrade to 10.08.0, or confirm your distro advisory names this fix. A backported build can carry an old version number.
  • Update WordPress: Move to 7.0.4 or 6.9.7 to close the core media upload route.
  • Rebuild bundles: Rebuild container images and app bundles. Patching the host leaves bundled copies untouched.
  • Check content, not extensions: Reject uploads that start with %! but claim to be images or PDFs.
  • Lock down printing: Unshare CUPS queues that don’t need sharing, and run document workers with minimal privileges.
  • Watch the renderer: Alert when gs, ImageMagick, or a print filter spawns a shell or writes outside its temp folder.

Upload2Shell Vulnerability Indicators of Compromise

Nobody has published file hashes or attack infrastructure, because no one has confirmed a real-world attack. The leads below come from the public proof of concept, so treat a hit as a reason to investigate, not proof of a breach.

Upload2Shell hunting leads: file names, PostScript strings, process behaviour and accounts from the public proof of concept

The Renderer Nobody Remembers Installing

Upload2Shell hides in libraries most teams never chose on purpose. Secure.com tests your upload, mail, and print paths the way an intruder would, hardens what it finds, and proves the fix held, while your team sets the rules.

  • Managed Exposure Management maps every Ghostscript copy, including those buried in containers and app bundles.
  • Fixes get ranked by real reach, so a public upload form gets patched before an internal batch job.
  • Every fix is retested against the live renderer, so “patched” comes with proof.
  • Managed SecOps watches around the clock for renderers spawning shells and shuts them down fast.

Conclusion

Upload2Shell shows that a file’s name says nothing about what’s inside it. Patch Ghostscript, rebuild anything that bundles it, and check what your preview jobs actually open. Exploit code is public and several distros are still waiting on fixes, so act now, before the first confirmed attack.

FAQs

What is the Upload2Shell vulnerability?
Upload2Shell is the name for CVE-2026-125396, a use-after-free bug in Ghostscript’s Type 1 font loader. A crafted PostScript file disguised as an image or PDF can switch off Ghostscript’s SAFER sandbox and run commands on the server that renders it.
Which Ghostscript versions are affected by CVE-2026-125396?
Every version before 10.08.0 carries the bug. Artifex fixed the bug in Ghostscript 10.08.0 on September 8, 2026. Distro builds may carry the fix under an older version number, so check your vendor’s advisory.
Is CVE-2026-125396 being exploited in the wild?
Nobody has confirmed an attack yet. As of November 20, 2026, CISA had not added it to its Known Exploited Vulnerabilities catalog. However, working proof-of-concept code is public, which raises the risk.
Why is the “local” CVSS score misleading?
The CVSS 4.0 score of 8.5 uses a local attack vector. In practice, researchers delivered the file remotely through web uploads, email previews, and network print jobs, so internet-facing servers are exposed.
How do I protect WordPress from the Upload2Shell vulnerability?
Update WordPress to 7.0.4 or 6.9.7, and upgrade Ghostscript on the server to 10.08.0 or a patched vendor build. Until you can patch, block PostScript content disguised as images and limit who can upload files.