learn deep. ship safe.Practice testsFollow ByteMunSubscribe
Cyber SecurityTrending #3

Upload2Shell Ghostscript Flaw: Who Is Exposed, How to Patch

Upload2Shell (CVE-2026-125396) lets a PostScript file disguised as an image or PDF run commands through Ghostscript. Here is which apps pwn.ai reached, how to find every Ghostscript copy, and which distros have fixed packages.

Upload2Shell illustration: a file labeled .png that contains PostScript flows into a Ghostscript renderer protected by a 10.08.0 patch shield
Upload2Shell hides PostScript inside files named like images or PDFs; Ghostscript 10.08.0 fixes the bug.

Status: Upload2Shell (CVE-2026-125396) is fixed in Ghostscript 10.08.0, released September 8, 2026. Ubuntu and Debian 13 have patched packages, and Debian 12 received its fix through DLA-4914-1. Amazon Linux was still pending and several SUSE products were still in progress when ByteMuni checked on November 22, 2026. This article will be updated as fixes land.

Upload2Shell is a Ghostscript vulnerability, tracked as CVE-2026-125396, that lets one crafted file run commands on the server that renders it. Security research group pwn.ai, crediting researcher Paulos Yibelo, reports command execution through a CUPS print queue, Roundcube webmail, WordPress and two of its plugins, two wikis and two document systems. The Ghostscript fix has existed since September. The open risk is old copies of Ghostscript inside apps, distros and containers.

Scope: VulnCheck's advisory lists every Ghostscript (ghostpdl) version before 10.08.0 as affected. VulnCheck is the CVE Numbering Authority that assigned the ID. Whether a given app is reachable without a login depends on the app and its settings, as the table below shows. The Hacker News reported the research. This article is built from the researchers' pages, the CVE record and vendor trackers.

What Upload2Shell is: a PostScript file wearing an image's name

Ghostscript, Artifex's open-source interpreter for PostScript and PDF, is rarely called by name. Image libraries start it in the background when they make a thumbnail, draw a preview or convert a PDF or EPS file. Many site owners never know it is installed.

The attack uses that habit. According to pwn.ai's technical write-up, the attacker sends PostScript content under a trusted name. Its tests used a .pdf name in the ImageMagick and WordPress path, a .jpg declared as image/jpeg in Roundcube, and EPS bytes named .png in the Pillow tests. The write-up's point is that the decoder a library picks from the file's content matters more than the file name.

Upload2Shell flow diagram: an upload passes through an app and an image library into Ghostscript before 10.08.0, which runs a command
The path pwn.ai describes: an app hands the upload to a library, the library starts Ghostscript, and the bug turns off -dSAFER in memory (source: pwn.ai).

Which apps pwn.ai turned into Upload2Shell targets

The table lists the apps where pwn.ai says it observed command execution. Most ran Ghostscript 10.05.1. These are the researchers' own results and have not been independently reproduced.

App and tested versionNeeds login?Runs asCondition, per pwn.ai
CUPS on Debian 13No (anonymous IPP)lpShared network print queue accepts the job
Roundcube 1.7.2No for the outside senderwww-dataImageMagick delegate in use; recipient views the message, no attachment click
Forminator 1.55.1 (WordPress 7.0.2)Nowww-dataPublic PDF form with Media Library storage on
Essential Addons for Elementor Lite 6.7.0Nowww-dataPublic Login/Register widget with an upload field
WordPress core (tested 6.9.4)Yes: upload_files (Author and up by default)www-dataImagick and Ghostscript installed
MediaWiki 1.46.0 + PdfHandlerNowww-dataAnonymous uploads allowed
DokuWiki 2026-07-14aNowww-dataOpen wiki; optional ImageMagick backend
Mayan EDMS 4.11.5 (official image)No (external email)uid 1000 in the containerPOP3 document inbox imports the attachment
ResourceSpace 11.0Yes, or a valid upload-share linkPreview worker (user not stated)Authenticated upload
Plesk Obsidian 18.0.79 (Roundcube 1.6.17, Ghostscript 9.54.0)Not statedroundcube_sysuserAppArmor blocked the shell in an enforced test

pwn.ai also says a Google production service ran Ghostscript 10.05.0 on attacker-hosted files, and that Google mitigated that path on November 10. Gradio, ComfyUI, Paperless-ngx and others are listed only as source-mapped or partly tested.

Upload2Shell timeline and the AI claim

According to pwn.ai, the bug was found on July 27, 2026. Artifex had the report (bug 709684) by September 2 and released 10.08.0 on September 8. Vendor reports went out on September 17–18, Ubuntu shipped fixes on October 21, and the CVE was published on November 9.

pwn.ai's write-up credits "GPT 5.6 Sol, working with @PaulosYibelo," with finding the issue in .putgstringcopy. pwn.ai's main impact page credits only "Research by Paulos Yibelo." No other party has confirmed how the bug was found. The claim is pwn.ai's own.

Does my stack call Ghostscript?

The library your code uses decides whether an upload reaches Ghostscript. These results come from pwn.ai's write-up and its tested versions.

Library or appWhen it calls GhostscriptExposed, per pwn.ai?
ImageMagick (incl. PHP Imagick)Detects PostScript from content and hands it to the Ghostscript delegateYes (tested 6.9.12-98)
Pillow 13.0.0 (Python)load(), crop() or thumbnail() on EPS content, even named .png; Image.open() alone only identified the fileYes
libvipsDepends on the build; tested 8.15.1 chose magickload, then ImageMagick and GhostscriptBuild-dependent
CUPSPrint filters render PostScript jobsYes, on a shared queue
PHP GD, OpenCV, prebuilt Sharp, JimpDid not start Ghostscript for the tested inputsNot affected for these inputs

A separate Pillow flaw is covered in our Pillow vulnerability guide. Upload2Shell is different: an up-to-date Pillow still calls whatever Ghostscript is on the system.

How the Ghostscript vulnerability works, and why -dSAFER doesn't stop it

Ghostscript's -dSAFER mode is a sandbox. It stops a document from opening files or running commands. Upload2Shell switches that sandbox off from inside memory. pwn.ai's write-up and VulnCheck's advisory describe this chain:

  1. A PostScript helper called .putgstringcopy, in Resource/Init/gs_fonts.ps, calls the privileged .forceput operator without checking operand types.

  2. A malformed Type 1 font triggers a typecheck error. The document's own error handler supplies operands that let the privileged write go ahead.

  3. The stored reference outlives a local object that restore frees. That is a use-after-free.

  4. Writing through the stale reference gives the attacker a write-what-where primitive.

  5. The exploit uses it to change Ghostscript's path-control state, set PermitFileWriting to allow everything, and clear a cached LockFilePermissions flag.

A use-after-free means code keeps a pointer to memory that has already been released. Whatever lands in that memory next can be read or overwritten through the old pointer. As the write-up puts it, "-dSAFER was still on the Ghostscript command line; its native file-path check had been disabled in memory." Adding -dSAFER is not a workaround.

Why a "local" CVSS score still meant remote attacks

The CVE record carries two scores from VulnCheck: CVSS 4.0 at 8.5 (AV:L/AC:L/AT:N/PR:N/UI:P) and CVSS 3.1 at 7.8. SUSE lists the same numbers. The attack vector is Local because the score rates Ghostscript as a program that opens a file it is given. It does not rate the web app, mail server or print queue that passes a stranger's file to Ghostscript. That hand-off is how pwn.ai reached it over the network.

Upload2Shell fix status by distro and app

Distros backport fixes, so a patched package can still report an old version number. Debian 12's fixed build still says 10.0.0. Compare the full package version, not just gs --version. The statuses below were checked on each vendor's tracker on November 22, 2026, unless noted.

PlatformStatusFixed package or note
Ghostscript upstreamFixed10.08.0 (September 8, 2026)
Ubuntu 26.10 / 26.04 / 24.04 / 22.04Fixed (USN-8949-1, Oct 21)10.07.1~dfsg-1ubuntu2.1 / 10.06.0~dfsg-3ubuntu1.2 / 10.02.1~dfsg1-0ubuntu7.10 / 9.55.0~dfsg1-0ubuntu5.15
Ubuntu 20.04, 18.04, 16.04Fixed via Ubuntu Pro9.50~dfsg-5ubuntu4.15+esm3, 9.26~dfsg+0-0ubuntu0.18.04.18+esm6, 9.26~dfsg+0-0ubuntu0.16.04.14+esm11
Debian 13 trixieFixed (DSA-6516-1)10.05.1~dfsg-1+deb13u2; current +deb13u3
Debian 12 bookwormFixed (DLA-4914-1)10.0.0~dfsg-11+deb12u9; deb12u8 is vulnerable
Debian forky / sidFixed10.08.0~dfsg-2
Amazon Linux 2, 2023Pending fixNo advisory yet
openSUSE TumbleweedFixed10.08.0-5.1
SLES 15 SP4–SP7, 12 SP5-LTSSFix in QA9.52-150000.222.1; 12 SP5-LTSS 9.52-23.108.1
openSUSE Leap 16.0, 16.1AffectedNo fix listed
Red Hat Enterprise LinuxNot establishedRed Hat's bug 2569593 was still "NEW"; no advisory found
Arch Linux / Alpine EdgeFixed, per pwn.ai10.08.0-1 / 10.08.0-r0 (not confirmed on their trackers)
WordPress coreFixed7.0.4, August 12 (CVE-2026-65640)
RoundcubeFixed1.6.20 / 1.7.5, October 19 (CVE-2026-114727)

Ubuntu's notice names other Ghostscript CVEs plus one font issue with no number. The mapping of USN-8949-1 to CVE-2026-125396 comes from pwn.ai's table. WordPress's release post describes its fix as stopping "Authenticated Author+ remote code execution via malicious file upload" on sites using Imagick and Ghostscript. The WordPress and Roundcube updates block the upload path. Ghostscript itself still needs its own update.

How to check your servers and Docker images

Start by finding every copy of Ghostscript, then compare package versions with the table above.

# Is Ghostscript installed, and which upstream version?
command -v gs && gs --version

# Debian / Ubuntu: the full package version shows backported fixes
dpkg -l | grep -E 'ghostscript|libgs'

# RHEL, Amazon Linux, SUSE
rpm -q ghostscript

# Alpine
apk info -v | grep ghostscript

Containers carry their own copy, so check each image you run. If the image sets an entrypoint, override it:

docker run --rm --entrypoint gs <image> --version
docker run --rm --entrypoint sh <image> -c "dpkg -l | grep libgs"

Check what ImageMagick will hand to delegates, and whether Pillow can find Ghostscript:

magick identify -list policy      # ImageMagick 7
convert -list policy              # ImageMagick 6
python3 -c "from PIL import EpsImagePlugin; print(EpsImagePlugin.has_ghostscript())"

An empty policy list means ImageMagick uses its defaults. True from Pillow means EPS uploads can reach Ghostscript. Panels and bundled apps may ship their own Ghostscript; pwn.ai's Plesk test found 9.54.0. The rollout checks in our PHP2Shell Docker update guide apply here too: rebuild from a patched base and confirm the running container, not just the Dockerfile.

Upload2Shell mitigations if you can't patch yet

  • Stop anonymous printing. Run cupsctl --no-share-printers or require authentication on shared queues. Trade-off: network clients that print without a login stop working.

  • Check uploads before any image processing. Reject anything that is not an allowed type by its content, before a thumbnail is made. Trap: an extension check alone fails, because the libraries choose a decoder from the bytes. In Pillow, Image.open(fp, formats=["PNG", "JPEG"]) refuses other decoders.

  • Lock down ImageMagick. ImageMagick's security policy page gives <policy domain="delegate" rights="none" pattern="*"/>, which it says disables "all external delegates (Ghostscript, ffmpeg, etc.)". Its example also has <policy domain="coder" rights="write" pattern="{MVG,PDF,PS,SVG,TXT,XPS}"/>. That example does not name EPS. Trade-off: PDF previews and video thumbnails stop. Confirm the change with magick identify -list policy.

  • Contain the preview worker. Run it as a low-privilege user under AppArmor or a locked-down container. In pwn.ai's Plesk test, enforced AppArmor blocked the shell. This limits damage. It is not a fix, because the attacker's code still runs inside that worker.

Is CVE-2026-125396 exploited, and who needs to act first?

The only public proof of concept is limited. According to pwn.ai, a 104-line PostScript file shows native memory control and "does not execute a shell command or touch host files." The full command-execution chain is described but not published. ByteMuni found no reports of in-the-wild exploitation. The CVE was not among CISA's Known Exploited Vulnerabilities additions when ByteMuni checked on November 22, 2026.

Signs worth checking include unexpected child processes of gs, lp or www-data, and odd PostScript files with image extensions in upload folders. None of these proves an attack, and their absence doesn't prove safety. In priority order, these are the teams that should act first:

  1. Anyone with a CUPS queue shared on a network, especially one reachable from the internet.

  2. Webmail hosts running Roundcube, including Plesk and cPanel servers, since an incoming email is enough.

  3. WordPress sites with public upload forms (Forminator, Essential Addons) and Imagick installed. Shared hosting customers should ask their host which Ghostscript is on the server.

  4. Wikis that allow anonymous uploads, and document systems with email inboxes.

  5. Docker images built on Debian 12 before deb12u9, on Amazon Linux, or on any base pinned months ago.

My take on Upload2Shell

My read is that Upload2Shell is a dependency-inventory problem more than a Ghostscript problem. Few teams decide to run Ghostscript. It arrives through ImageMagick, a CUPS filter or a Docker base image. The upstream patch has been out for more than ten weeks by our count, and the copies that matter now are the ones nobody listed. Teams should list every binary their upload path can start, then rebuild images on a schedule rather than only when a CVE makes news. Our Ruby2Shell patch coverage shows the same pattern for a language runtime: a fix only counts once it reaches the copy that is running.

Frequently asked questions

Is Upload2Shell a remote, unauthenticated bug?

It depends on the app. pwn.ai reached CUPS, Roundcube, Forminator, Essential Addons, MediaWiki and DokuWiki without a login, while WordPress core needs the upload_files capability and ResourceSpace needs an authenticated upload or share link.

I updated WordPress to 7.0.4. Am I safe?

WordPress 7.0.4 closes the core upload path that pwn.ai reported (CVE-2026-65640). The server's Ghostscript still needs updating, because plugins and other apps on the same server can also pass files to it.

Why does my patched Debian 12 server still show Ghostscript 10.0.0?

Debian backports security fixes without changing the upstream version. The fixed bookworm package is 10.0.0~dfsg-11+deb12u9, so check the package version with dpkg -l, not just gs --version.

Does Pillow's Image.open() trigger the bug?

In pwn.ai's tests with Pillow 13.0.0, Image.open() only identified the file. Calling load(), crop() or thumbnail() on EPS content started Ghostscript, even when the file was named .png.

Is there a public exploit for CVE-2026-125396?

pwn.ai has published only a 104-line proof of concept that shows memory control and does not run a shell command. ByteMuni found no reports of in-the-wild exploitation as of November 22, 2026.

Does the ImageMagick policy change fix Upload2Shell?

No. Blocking delegates in policy.xml stops ImageMagick from handing files to Ghostscript, but it does not patch Ghostscript, and it also disables PDF previews and other delegates such as ffmpeg.

Concepts in this article

CISA KEV catalog
The US list of vulnerabilities known to be exploited in the wild.
CVE
The public identifier system for disclosed security vulnerabilities.
Docker
A tool for packaging and running applications in containers.
PHP
A server-side scripting language behind much of the web, including WordPress.
Pillow
The Python imaging library.
Remote code execution (RCE)
A flaw that lets an attacker run their own code on a system over the network.
Vulnerability management
Finding, ranking and fixing vulnerabilities across systems.
WordPress
The most widely used website content management system, written in PHP.

How we research, write and check articles

Written by

· Senior Software Engineer

Deepak Kumar is a Senior Software Engineer based in New Delhi. He maintains production systems with millions of readers, where a missed patch is an incident rather than a headline. He started ByteMuni to publish clear, source-checked guides for working developers.