Skip to content

· 7 min read

Upload2Shell (CVE-2026-125396): can a file upload run code on your server? How to check and fix it

A Ghostscript bug lets a crafted upload run commands on the server, through ordinary features like PDF previews and image thumbnails. Which sites are affected, including WordPress with Forminator or Essential Addons for Elementor, how to check your Ghostscript version, and the fixed packages.

Vishal Solanki · Full-stack developer, Noida

In November 2026, security researchers at pwn.ai published Upload2Shell (CVE-2026-125396), a bug in Ghostscript, the program many servers use to read PDF and PostScript files. A crafted file can break out of Ghostscript's sandbox and run commands on the server.

The file doesn't have to look dangerous. In the researchers' tests, it reached Ghostscript through everyday features: a WordPress PDF preview, a public form that accepts a PDF, an email attachment thumbnail, even a file named .jpg or .png.

Short version: if your server has Ghostscript installed, update it to 10.08.0 or your Linux distribution's fixed package, then restart anything that processes uploads. If you run WordPress, also make sure you're on 7.0.4 or your branch's patched release. If you use Docker, rebuild your images: updating the host doesn't update the Ghostscript inside a container.

Last checked: 22 November 2026. The researchers are still publishing product write-ups, so details may change. The sources are at the end.

What Upload2Shell is, in plain words

Ghostscript reads PDF and PostScript files. PostScript is a full programming language, so "opening" a PostScript file really means running a small program. Ghostscript runs it inside a sandbox (its -dSAFER mode) that is supposed to stop the file from touching your server.

Upload2Shell is a memory bug in Ghostscript's font loader. A crafted document can use it to switch those sandbox checks off and run commands as whatever user is rendering the file, often the web server user.

Your code probably never calls Ghostscript directly. It gets there through a chain:

  • PHP: Imagick (the PHP binding for ImageMagick) → ImageMagick → Ghostscript. This is the WordPress route.
  • Python: Pillow, when it loads or crops EPS content, even if the file is named .png.
  • libvips: only in builds whose ImageMagick loader is enabled. The researchers call this route build dependent.

So the question to ask isn't "does my app use Ghostscript?" but "does anything that touches uploaded files end up calling Ghostscript?" Thumbnails, PDF previews, document imports and print jobs are the usual places.

Who is affected?

The researchers confirmed command execution in these setups:

SoftwareWho could trigger it
WordPress core (before 7.0.4)Any user who can upload media: Authors and above by default. The server needs Imagick and Ghostscript.
WordPress + Forminator (tested on Forminator 1.55.1, WordPress 7.0.2)Any visitor, no login, through a public form with a PDF upload field set to store files in the Media Library
WordPress + Essential Addons for Elementor Lite (tested on 6.7.0, WordPress 7.0.2)Any visitor, no login, through a public Login/Register widget with an upload field and registration turned on
Roundcube webmailAn outside sender. The recipient only had to open the email, not the attachment. The test setup used a permissive ImageMagick configuration.
Debian 13 print servers (CUPS)Anyone who can reach a shared print queue that doesn't require a login
MediaWiki (PdfHandler), DokuWiki, Mayan EDMS, ResourceSpace, Plesk ObsidianVaries by setup; see the researchers' table

They also reached Google's document processing, which Google fixed on 10 November.

According to the researchers, the Ghostscript CVE scores the bug 8.5 out of 10 (CVSS 4.0) as a local attack, even though every chain above delivered the file remotely. WordPress rated its own part of the problem High (8.8).

Is it being exploited? As of 22 November, none of the sources below report attacks in the wild. The research write-up does include a working proof-of-concept file for the memory bug, and more product write-ups are on the way. Patch now, while that's still true.

How to check and fix it

WordPress (any hosting)

  1. Go to Tools → Site Health → Info → Media Handling. Look at Active editor, Imagick version and Ghostscript version.
    • If Ghostscript shows Not available, WordPress couldn't find the gs command on the server. If it says Unable to determine, your host blocks the check, so ask them.
    • If it shows a version number, Ghostscript is installed, and if the active editor is Imagick, your uploads can reach it.
  2. Update WordPress to 7.0.4 or your branch's patched release. WordPress backported the fix to every branch back to 4.7, so 6.9.7, 6.8.8 and so on also count. This is WordPress's mitigation for its upload route. It doesn't change the Ghostscript bug itself.
  3. If you use Forminator PDF uploads or Essential Addons for Elementor registration uploads, keep those plugins and WordPress updated. The researchers tested those routes on WordPress 7.0.2 and haven't said whether 7.0.4 or newer plugin versions block them. Updating Ghostscript on the server fixes the bug underneath every route.

Don't rely on the version number alone. Linux distributions often fix a bug in an older-looking version (Ubuntu 24.04's fixed package is still 10.02.1, for example), so 10.02.1 on its own doesn't tell you whether you're patched.

Shared hosting

You can't update Ghostscript yourself here, so ask your host. A message you can send:

Hi, my site [domain] is hosted with you. Is Ghostscript installed on the server, and if so, does it include the fix for CVE-2026-125396 (Upload2Shell)? The upstream fix is Ghostscript 10.08.0.

VPS or dedicated server

Check which Ghostscript packages are installed:

gs --version                          # upstream version, if the gs command exists
dpkg -l | grep -E 'ghostscript|libgs' # Debian / Ubuntu: actual package versions

Ghostscript can also be linked into another program as a library, so a missing gs command doesn't prove it isn't there. Look for the libgs packages too.

Then update and restart the services that process uploads (PHP-FPM, workers, queues):

sudo apt update && sudo apt upgrade

Fixed packages for Ubuntu (from Ubuntu's notice USN-8949-1, published 21 October):

Ubuntu releaseFixed package version
26.1010.07.1~dfsg-1ubuntu2.1
26.04 LTS10.06.0~dfsg-3ubuntu1.2
24.04 LTS10.02.1~dfsg1-0ubuntu7.10
22.04 LTS9.55.0~dfsg1-0ubuntu5.15
20.04, 18.04, 16.04 LTSFixed through Ubuntu Pro (see the notice)

Fixed packages for Debian (from Debian's security tracker):

Debian releaseFixed package version
12 (bookworm), security10.0.0~dfsg-11+deb12u9
13 (trixie)10.05.1~dfsg-1+deb13u2 or later
14 (forky) and unstable10.08.0~dfsg-2

On other systems, update to Ghostscript 10.08.0 or your vendor's fixed build. According to the researchers, as of 12 November Amazon Linux still listed the fix as pending and several SUSE releases were still in progress, so check your vendor's CVE page rather than assuming.

Docker and containers

The researchers point out a common gap: updating the host doesn't update a copy of Ghostscript inside a container image. Rebuild images that process documents or images on a patched base, redeploy, and make sure no old containers are still running. This includes third-party images you didn't build, such as document management tools.

Print servers

If you run CUPS with shared queues, require authentication on them. In the researchers' Debian test, a login on the queue blocked the anonymous print job.

Running Next.js or Node.js?

Upload2Shell isn't a Next.js or Node.js bug. What matters is whether anything on your server passes uploaded files to Ghostscript: a PDF preview service, an ImageMagick resize step, or a Python worker that uses Pillow. The researchers list libvips, the image library that sharp uses, as a route only in builds where its ImageMagick loader is turned on. If your app accepts uploads and your server or container has Ghostscript installed, run the checks above.

The same lesson applies to every stack: checking that an upload is "a .jpg" isn't enough if a library further down decides what the file really is and hands it to an interpreter.

FAQ

I don't allow uploads. Am I safe?

You're much less exposed, but check the less obvious places: any form with a file field (like the Forminator and Essential Addons routes above), webmail, document tools and print servers. Those are the kinds of routes the researchers used.

I updated WordPress. Is that enough?

It's WordPress's fix for its own upload route, and you should have it. The bug itself lives in Ghostscript, which plugins, webmail and other software on the same server can also reach. Update Ghostscript on the server too.

Does a security plugin protect me?

Don't count on it. The file looks like a normal upload, and the bug triggers later, when the server makes a preview. The fixes the vendors have shipped are in Ghostscript and WordPress, so update those.

How do I know the fix worked?

Compare your installed package version with the tables above or your vendor's advisory, not just the gs --version number. Restart the services that process uploads, and rebuild any containers.

Related

Sources


Not sure whether your server runs Ghostscript, or whether your host has patched it? I can check your setup and apply the fix. Get in touch.

  • Security
  • Ghostscript
  • Upload2Shell
  • WordPress