Skip to content
Back to the blog

Upload2Shell: Ghostscript sandbox escape turns file uploads into RCE

Breaches & Vulns

Nov 23, 2026 · 21 min read

Upload2Shell, tracked as CVE-2026-125396, is a use-after-free in the Type 1 font loader of Ghostscript, the PostScript and PDF interpreter that ImageMagick, Pillow, CUPS, and many document pipelines call to render files. According to the write-up from pwn.ai, which named the flaw, a crafted document can use it to switch off Ghostscript’s -dSAFER sandbox from inside the interpreter and run commands as the rendering process. pwn.ai reports command execution through file uploads, email attachments, and print jobs in Debian 13 CUPS, Roundcube, WordPress, MediaWiki, and six other applications. Artifex fixed the flaw in Ghostscript 10.08.0 on September 8, 2026.

The CVE scores 8.5 under CVSS 4.0 with a local attack vector, because Ghostscript only reads files that another program hands it. In seven of the ten paths pwn.ai documents, the attacker needed no account on the target. pwn.ai has published a proof of native memory control, and we found no reports of exploitation in the wild as of November 23.

The fix is in Ghostscript, so it has to reach every copy that renders untrusted files, including the ones bundled in container images and hosting stacks. Upgrading the application that accepts the upload does not replace the interpreter underneath it.

Vulnerability details

FieldValue
CVECVE-2026-125396, published November 9, 2026. Upstream report Artifex Bug 709684
NicknameUpload2Shell, from pwn.ai
CreditFound by GPT 5.6 Sol working with Paulos Yibelo of pwn.ai, according to the pwn.ai write-up. Paulos Yibelo reported it to Artifex
Severity8.5 High under CVSS 4.0 and 7.8 High under CVSS 3.1, scored by VulnCheck. Ubuntu rates it medium and Red Hat Important
CVSS 4.0 vectorAV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Flaw typeUse-after-free reached through misuse of a privileged operator (CWE-648)
Affected component.putgstringcopy in Resource/Init/gs_fonts.ps, the Type 1 font loader
Affected versionsGhostscript before 10.08.0
Fixed versionsGhostscript 10.08.0, plus distribution backports listed below. The same release also fixes CVE-2026-39919, a separate JPEG 2000 heap overflow
PreconditionsAn attacker-supplied PostScript file reaches Ghostscript, directly or through ImageMagick, Pillow, CUPS, or another library. The file can carry a .pdf, .jpg, or .png name, and its declared type does not need to match the content
Access neededNone in the documented CUPS, WordPress plugin, and open-wiki paths; an email to a Roundcube user or to a Mayan EDMS instance with a POP3 document source; upload rights in WordPress Core; upload rights or an upload-share link in ResourceSpace
Upstream fixghostpdl@1484854e0c8d, included in 10.08.0, with a follow-up after the release in ghostpdl@e0421767e136
Related application CVEsCVE-2026-65640 (WordPress Core, rated 8.8 by WordPress for sites running Imagick with Ghostscript) and CVE-2026-114727 (Roundcube)
ExploitationNo reports in the wild as of November 23. Not in the CISA KEV catalog as of November 21, according to Ostorlab. Brandefense counted one dark-web chat post matching the CVE from August 23 through November 21 and says that discussion cannot establish exploitation. pwn.ai has published a proof of native memory control and excerpts of the command-execution chain, but not a working command-execution exploit

TL;DR

  • Ghostscript before 10.08.0 lets a crafted PostScript file turn off its own -dSAFER sandbox and run commands as the process that renders it. pwn.ai reports command execution through ten applications, seven of them without an account on the target.
  • The file does not need a PostScript name. A .jpg attachment or a .png upload whose bytes are PostScript reaches Ghostscript through ImageMagick or Pillow when the application builds a thumbnail or preview.
  • Upgrade Ghostscript to 10.08.0 or your distribution’s fixed package, then rebuild any container image that bundles it. Debian 12 now has a fix through Debian LTS.
  • Update WordPress to 7.0.4, 6.9.7, or a listed backport, and Roundcube to 1.6.20, 1.7.5, or later, which carry the CVE-2026-114727 fix. Both close an application route to Ghostscript.
  • Until every copy is patched, disable the PS, EPS, PDF, and XPS coders in ImageMagick’s policy where you do not need them, and require authentication on shared CUPS queues.

Who is not affected by Upload2Shell

A system is out of scope when no attacker-supplied file reaches a vulnerable Ghostscript. Based on the tests in the pwn.ai write-up, that covers:

  • Image handling through PHP GD, OpenCV, prebuilt Sharp, Jimp, Java ImageIO, or Go’s standard image decoders, none of which started Ghostscript for the same PostScript inputs.
  • Applications that only copy or store uploaded files without rendering, resizing, or previewing them.
  • Python code that calls Pillow’s Image.open() to identify a file but never loads its pixels.
  • Hosts and images running Ghostscript 10.08.0 or a distribution package that carries the fix, where pwn.ai’s proof fails.

libvips and Qt applications depend on how they were built. In pwn.ai’s tests, a libvips build with the magickload loader and a Qt install with the KImageFormats EPS plugin both reached Ghostscript, so check the loaders and plugins actually installed before ruling them out.

Ghostscript can also be linked into ImageMagick as a library rather than run as a separate gs command, so the absence of a gs binary on the path is not proof that a host is safe.

What is Upload2Shell?

Upload2Shell is a flaw in the way Ghostscript loads Type 1 fonts, and it affects any application that passes files it did not create to Ghostscript, directly or through a library. PostScript is a full programming language, so rendering a PostScript file means running a program written by whoever sent it. Ghostscript’s -dSAFER mode restricts that program’s file access and command execution, but those restrictions are checks inside the interpreter, not a kernel-enforced filter like seccomp. A memory corruption bug inside the interpreter can therefore disable them.

Most applications never call Ghostscript by name. They call an image or document library that often chooses a handler from the file’s bytes rather than its name and passes PostScript and PDF to Ghostscript. pwn.ai traced these routes in its tests on Ubuntu 24.04, including with PostScript content saved under a .png name:

Library and tested versionCallRoute to Ghostscript
Pillow 13.0.0Image.open() then load(), crop(), or thumbnail()Pillow’s EPS decoder starts Ghostscript when pixels are needed
imageio 2.38.2, scikit-image 0.26.0imread()Through Pillow
PHP 8.3.6 Imagick with ImageMagick 6.9.12-98Imagick::readImage()ImageMagick’s PostScript delegate
libvips 8.15.1 (pyvips, Ruby Vips)new_from_file() with pixel access, or thumbnail()magickload, then ImageMagick; depends on installed loaders
Qt KImageFormats 5.115.0QImageReader.read()EPS plugin calls Ghostscript directly
Matplotlib 3.11.2matplotlib.image.imread()Only for files named .eps; the same bytes named .png were rejected

CUPS reaches Ghostscript by a third route. A PostScript print job passes through the gstopdf filter, which runs the system Ghostscript with -dSAFER as the lp user.

Upload2Shell is one of several Ghostscript flaws pwn.ai found and reported to Artifex during the same audit. Its separate findings at Dropbox and other production services whose names pwn.ai redacted have different root causes and are not covered here.

Technical analysis

The flaw lets a document borrow a privileged write from Ghostscript’s own font code and use it to break the interpreter’s memory rules. The analysis below follows the pwn.ai write-up and the upstream fix. We have not reproduced it in a lab.

The font helper

Ghostscript implements parts of its font loading in PostScript. One helper, .putgstringcopy, has to write into protected font dictionaries, so it uses .forceput, an internal operator that ordinary documents cannot call. The helper copies a string and then performs the privileged store, but it never checked that its operands had the expected types.

From a type error to a privileged write

A font loaded from the document can see the loader’s operand stack while it runs. pwn.ai’s proof swaps the expected filename string for an array, so the copy step fails with a typecheck error. The document’s own error handler then rearranges the stack and returns, and execution resumes at .forceput with a dictionary, key, and value the attacker chose. The document never calls the hidden operator by name.

The dangling reference

PostScript keeps local and global memory apart. A save records local state, and a later restore frees local objects created since then, while global objects can survive. A surviving global dictionary must never point at a local object, because that object will be freed.

The recovered .forceput breaks that rule. It stores a local object into systemdict, which outlives the restore, leaving a reference to freed memory. When the interpreter reuses that allocation for new objects, the stale reference and the new object point at the same bytes. pwn.ai used that overlap to read and write native memory and follow Ghostscript’s internal pointers to the structure that holds its path-control state. The offsets it reports are specific to the tested x86-64 build, but the addresses come from live interpreter references, so the proof does not depend on guessing a fixed address.

Turning off -dSAFER from inside

With native write access, the proof clears the flag that enables path control, changing its bytes from 1,0,0,0 to 0,0,0,0. It also uses the privileged store to widen the file-writing allowlist and unlock file permissions that -dSAFER sets. -dSAFER is still on the command line, but the checks behind it are off, and the document can open a pipe to a shell command. In the Debian CUPS test, that command ran on the print server as uid=7(lp).

The fix

Artifex’s first commit, included in 10.08.0, checks the operands before the copy can fail, which removes the error path that exposed .forceput. A second commit, made after the 10.08.0 release, moves the helper into C so it no longer depends on .forceput at all. pwn.ai reports that on 10.08.0 its proof fails before the pointer write.

Which products are affected?

Applications in which pwn.ai reports command execution through Upload2Shell, from its evidence index as updated on November 18, 2026:

Product (tested version)Who can deliver the fileCommand ran asFix or status
Debian 13 CUPSAnyone who can send a print job to a shared queue without authenticationlpGhostscript 10.05.1~dfsg-1+deb13u3; require authentication on shared queues
Roundcube 1.7.2Any external sender, where ImageMagick’s policy lets PostScript through; the recipient only has to view the messagewww-dataRoundcube 1.6.20 and 1.7.5 restrict unsafe image types before conversion, CVE-2026-114727 (October 19)
Plesk Obsidian 18.0.79, with Roundcube 1.6.17 and Ghostscript 9.54.0Any external sender, through the bundled Roundcube thumbnail path (pwn.ai tested the component directly, not the deployed endpoint)roundcube_sysuserReported to WebPros. AppArmor blocked the shell in an enforced test
WordPress Core 7.0.0 to 7.0.3, 6.9.0 to 6.9.6, and earlier branches (tested: 6.9.4, local renderer)Authors and above, or a Contributor granted upload_files, on sites with Imagick and Ghostscriptwww-dataWordPress 7.0.4, 6.9.7, and backports, CVE-2026-65640 (August 12)
Forminator 1.55.1 on WordPress 7.0.2Signed-out visitors, through a public PDF field that stores files in the Media Librarywww-dataReported to the plugin team; update Ghostscript and WordPress
Essential Addons for Elementor Lite 6.7.0Signed-out visitors, through a Login/Register widget with an upload field and registration enabledwww-dataReported to the plugin team; update Ghostscript and WordPress
MediaWiki 1.46.0 with PdfHandlerAnonymous users, on wikis configured to accept anonymous uploadswww-dataReported to Wikimedia Security; update Ghostscript
DokuWiki 2026-07-14aAnonymous users, on open wikis using the optional ImageMagick backend and a permissive policywww-dataReported; update Ghostscript
Mayan EDMS 4.11.5Any external sender, on instances with a POP3 document sourceuid=1000 in the app containerReported; rebuild the container with a fixed Ghostscript
ResourceSpace 11.0 r29423Logged-in users or holders of an upload-share linkPreview worker accountUpdate Ghostscript

Google’s image and document pipeline also reached Ghostscript 10.05.0 from a signed-out request, and pwn.ai’s proof read a file on the worker. Google mitigated that path on November 10.

pwn.ai traced further routes in source code or up to the point where Ghostscript starts, without a command-execution proof: Gradio, InvokeAI, AUTOMATIC1111 Stable Diffusion WebUI, ComfyUI, Frappe and ERPNext, Home Assistant, CVAT, Paperless-ngx, and django-filer. Self-hosted AI image tools on that list often run without a login, so treat any internet-facing instance on a host with Ghostscript installed as potentially exposed.

Ghostscript packages, as of the dates shown:

PlatformStatusPackage or noteSource
Debian 12 (Bookworm)Fixed10.0.0~dfsg-11+deb12u9 (DLA-4914-1)Debian tracker, November 23
Debian 13 (Trixie)Fixed10.05.1~dfsg-1+deb13u3Debian tracker, November 22
Debian 14 (Forky) and SidFixed10.08.0~dfsg-2Debian tracker, November 22
Ubuntu 26.10, 26.04, 24.04, and 22.04; Ubuntu Pro 20.04 and 18.04, and 16.04 with the Legacy Support add-onFixedUSN-8949-1, for example 10.02.1~dfsg1-0ubuntu7.10 on 24.04pwn.ai write-up, notice of October 21
Red Hat Enterprise LinuxNot establishedBug 2569593 open, high severityRed Hat Bugzilla, November 10
Amazon Linux 2, 2023, and 2027 PreviewPending fixVendor statusAmazon ALAS, page last modified November 12, checked November 23
SUSE Linux Enterprise 12 SP5 LTSS and selected 15 SP4 to SP7 linesIn progressProposed packages in QApwn.ai write-up, November 12
SUSE Linux Enterprise Server 16.0 and 16.1In progressVendor statuspwn.ai write-up, November 12
openSUSE Leap 16.0 and 16.1AffectedVendor statuspwn.ai write-up, November 12
Arch, Fedora Rawhide, Gentoo, Alpine 3.23 and later, FreeBSD, Homebrew, and MacPortsFixed10.08.0pwn.ai write-up
Artifex Windows installers, Chocolatey, and conda-forgeFixed10.08.0Artifex release, September 8

Debian’s tracker records deb13u2, from DSA-6516-1 on September 25, as the first Debian 13 build with the fix, and deb13u3 from October 10 as the current one. A distribution package also says nothing about the Ghostscript inside an application bundle: Plesk shipped 9.54.0 in the tested release, and container images keep whatever version they were built with.

What is the impact of Upload2Shell?

The worst case is code execution as the account that renders the file. None of the documented paths where pwn.ai names the account ran as root, despite at least one headline promising a root shell, but the accounts involved still reach a great deal. In its local WordPress renderer test, pwn.ai wrote a PHP file as www-data. On a typical host, that account can place files the web server will run and read the database credentials in wp-config.php. On a CUPS print server, the lp account gives a foothold on the host itself, and in Mayan EDMS the command ran as the application’s container user, which would typically be able to read the documents the system stores.

The delivery routes widen the set of people who can attack. On an affected Roundcube server, a user only has to open an email for the server to render its attachment, so anyone who can send mail to the organization can reach the renderer. Public WordPress forms and open wikis accept files from visitors with no account at all.

Two further consequences follow from the way the flaw is scored and reached:

  • The CVE carries a local attack vector, so vulnerability scanners and risk registers that rank by CVSS may place it below network-facing bugs. Only WordPress and Roundcube have issued application CVEs, both scored with a network attack vector.
  • Ghostscript runs as a short-lived child process in most of these paths. A failed exploitation attempt is likely to show up as a crashed or unusually long-running gs process, or a gs process that starts a shell, rather than as an application error. Where Ghostscript is linked in as a library, no separate gs process appears.

The scoring problem cuts the other way on Ubuntu. Ubuntu shipped its fix in USN-8949-1 before the CVE existed, labeled “No CVE number,” and the Swiss host Cyberdine reported that Ubuntu’s own CVE page still listed every release as needing evaluation. Scanners that match CVE IDs may therefore flag patched Ubuntu hosts, so check the package changelog for the font-loader fix rather than the CVE status page.

Which actions should security teams take?

1. Upgrade Ghostscript everywhere it renders untrusted files

Install Ghostscript 10.08.0 or your distribution’s fixed package. Artifex, the distributions, and pwn.ai all give this as the remediation for the root flaw.

  • Update the system package through your distribution, and confirm the fixed build rather than the upstream version number, since backports keep older version strings.
  • Rebuild container images after the base image is updated. Images pinned to an older tag or digest keep the vulnerable interpreter.
  • Restart long-running processes that load ImageMagick or Ghostscript as a library, such as PHP-FPM workers using Imagick, so they pick up the new code.
  • For bundled stacks such as Plesk, install the vendor’s update rather than replacing its Ghostscript by hand.
  • Update WordPress to 7.0.4, 6.9.7, or a listed backport, and Roundcube to 1.6.20, 1.7.5, or later, which include the CVE-2026-114727 fix.

On Debian 12, install 10.0.0~dfsg-11+deb12u9 from the LTS update DLA-4914-1, which also fixes three other 2026 Ghostscript CVEs.

2. Reduce exposure until you can patch

No single setting closes every route, but these measures cut the documented ones:

  • In ImageMagick, disable the PostScript and PDF coders in policy.xml wherever the application does not need them. The DokuWiki and Roundcube paths both required a permissive policy.
  • In Python code, restrict the formats Pillow will open, for example with Image.open(f, formats=["PNG", "JPEG", "GIF", "WEBP"]), so EPS content is rejected before any pixels are loaded.
  • Require authentication on shared CUPS queues, or stop sharing printers beyond trusted networks.
  • Turn off anonymous uploads in MediaWiki and DokuWiki, and remove upload fields from public WordPress forms and registration widgets until Ghostscript is fixed.
  • Check a file’s real content before any thumbnail or preview step, and reject the types you do not need. Roundcube’s fix, for example, stops passing EPS and SVG content to ImageMagick when it resizes images.
  • Run rendering workers under AppArmor, SELinux, or seccomp with no network access and no application secrets. In the Plesk test, an enforced AppArmor profile blocked the shell.

A starting ImageMagick policy entry:

xml
<policy domain="coder" rights="none" pattern="{PS,PS2,PS3,EPS,EPSF,EPSI,PDF,XPS}" />

The policy blocks legitimate PDF thumbnails too, so test it against your own previews before rolling it out.

3. Find exposed instances

No indicators of compromise or detection signatures have been published. To find Ghostscript in scope:

  • Check the installed package on each host, for example with dpkg -l ghostscript or rpm -q ghostscript, and compare it with the fixed builds above.
  • Check every container image that renders files, for example with docker run --rm <image> gs --version, because a host update does not reach the image.
  • List ImageMagick’s PostScript handling with magick -list format | grep -iE 'ps|pdf' (or convert -list format on ImageMagick 6) to see whether it will pass those formats to Ghostscript.
  • Search your code for Imagick::readImage, Pillow calls that load pixels after Image.open, imageio.imread, and libvips thumbnailing applied to uploaded files.
  • Prioritize internet-facing webmail, WordPress sites with public upload forms, open wikis, shared print servers, and self-hosted AI image tools, then internal document systems.

For detection, alert on gs processes started by a web, mail, or print account that spawn a shell or write outside their temporary directory. Repeated gs crashes tied to uploads from one source are a stronger lead than a single failure.

Timeline

DateEvent
November 21, 2026pwn.ai’s technical write-up and proof of native memory control carry this date. The page was first dated November 17
November 18, 2026pwn.ai updates its evidence index of affected applications
November 17, 2026Debian LTS publishes DLA-4914-1, fixing Debian 12 in 10.0.0~dfsg-11+deb12u9
November 10, 2026Google mitigates its affected processing path. Red Hat opens bug 2569593
November 9, 2026CVE-2026-125396 is published
November 6, 2026pwn.ai requests the CVE
October 21, 2026Ubuntu publishes USN-8949-1 for seven releases
October 19, 2026Roundcube restricts unsafe image types before conversion, CVE-2026-114727
October 10, 2026Debian publishes the current Debian 13 build, 10.05.1~dfsg-1+deb13u3
September 25, 2026Debian publishes DSA-6516-1, the first Debian 13 fix. pwn.ai posts a public teaser naming affected services
September 17 to 18, 2026pwn.ai reports command execution to Debian, Roundcube, WebPros, WordPress plugin teams, Wikimedia, and other vendors
September 8, 2026Artifex releases Ghostscript 10.08.0 with the fix
By September 2, 2026pwn.ai reports the flaw to Artifex as Bug 709684
August 12, 2026WordPress releases 7.0.4, closing the Core upload route
By July 30, 2026pwn.ai sends Google a production proof
July 27, 2026pwn.ai finds the font-loader path out of -dSAFER

pwn.ai says the Debian CUPS chain will be the first full case study and proof of concept in its series, with the other application write-ups to follow.

Why this keeps happening below the application

Upload2Shell follows several remote code execution flaws in widely deployed server software that we have covered this month: CVE-2026-119618 in Apache HTTP Server, Java4Shell in the JDK, nginx2root in nginx, Ruby2Shell in the Ruby interpreter, and CVE-2026-115560 in PHP. Like Java4Shell and Ruby2Shell, it sits in a routine step applied to incoming data, here a thumbnail, preview, or print conversion, that the application calls without treating it as a security boundary.

Ghostscript adds a twist of its own, and the font code is familiar ground: iTnews notes that Artifex fixed a related flaw in the same font-handling file in 2018, found by Tavis Ormandy of Google through fuzzing, and that Artifex says it is working to remove the privileged operation behind this class of bug. Ghostscript’s sandbox is a set of checks inside the same interpreter that runs the attacker’s program, so any memory corruption bug in that interpreter can switch the sandbox off. That is the pattern behind CVE-2024-29510, which BleepingComputer reported as exploited in July 2024 using EPS files disguised as JPG images, and Debian’s tracker lists further Ghostscript code-execution fixes in 2026, including CVE-2026-39919 and CVE-2026-101258.

Tracking adds the same problem we described for Ruby2Shell, from a different direction. There the flaw had no CVE at first; here the CVE exists but describes a local attack, so tools that rank by CVSS vector see a library bug that needs a user to open a file. For flaws in renderers and runtimes, the reliable check is an inventory of what each service actually runs on the files it accepts, the point we also made for PHP2Shell about distribution backports.

How Equixly helps

Upload2Shell is reached through ordinary upload, attachment, and import endpoints, so the first job is knowing which of them face the internet and which accept files from people without an account. Equixly maps the web applications and APIs that attackers can reach and records how each endpoint behaves, including the endpoints that accept files. Combined with your inventory of Ghostscript versions, that shows which upload and preview routes to fix first. For applications reachable only from your internal network, Equixly runs its tests through Space Link, a container you deploy inside that network.

Once pwn.ai publishes its application proofs, the same testing can check whether a file sent through your endpoints still reaches a vulnerable renderer and whether the upgrade closed the route. For the difference between a version match and a confirmed exposure, see Penetration testing vs. vulnerability scanning.

Book a demo to see how Equixly maps your exposed applications and APIs and tests them after you patch.


Did you like our post? Share it on social!

Related Articles

View all articles

  • Breaches & Vulns

    CVE-2026-115560: PHP session RCE needs no runtime switch

    CVE-2026-115560 is a pre-auth PHP RCE via upload progress in shared session stores with mixed serializers. Fixed in 8.6.0, 8.5.13, 8.4.28, 8.3.37, and 8.2.36.

  • Breaches & Vulns

    Ruby2Shell: Pre-auth heap overflow in Ruby 3.3, 3.4, and 4.0

    Ruby2Shell (GHSA-34m4-m9fh-gqp5) is a pre-auth heap overflow in Ruby that can lead to RCE in Rails and Sinatra apps. Fixed in Ruby 4.0.10, 3.4.13, and 3.3.14.


    • Alexandra WellsAlexandra Wells
    • Eugen SaraciEugen Saraci

    Nov 19, 2026

    Read more: Ruby2Shell: Pre-auth heap overflow in Ruby 3.3, 3.4, and 4.0
  • Breaches & Vulns

    nginx2root: Disabling HTTP/2 stops two of five nginx RCE flaws

    nginx2root: five unauthenticated RCE flaws in nginx, led by HTTP/2 CVE-2026-123007, plus a Linux kernel flaw to root. Who is affected and how to fix it.


    • Alexandra WellsAlexandra Wells
    • Alessio Dalla PiazzaAlessio Dalla Piazza

    Nov 18, 2026

    Read more: nginx2root: Disabling HTTP/2 stops two of five nginx RCE flaws