Research

Upload2Shell: A Fake .png or .pdf Gets Code Execution Through Ghostscript in WordPress, Roundcube and CUPS. Fixed in 10.08.0 Since September, Still Unfixed on Some Distros. Find Every Copy

Upload2Shell: A Fake .png or .pdf Gets Code Execution Through Ghostscript in WordPress, Roundcube and CUPS. Fixed in 10.08.0 Since September, Still Unfixed on Some Distros. Find Every Copy

Find every copy of Ghostscript you run and bring it to 10.08.0, or your distribution's patched package. That means every copy, not just the one on the host: "Updating the host operating system does not update a separate copy of Ghostscript inside an existing container image or application bundle," the researchers write. If a shared CUPS print queue is reachable by anyone, require authentication on it today.

The flaw is CVE-2026-125396, which its finders call Upload2Shell. Paulos Yibelo of pwn.ai published the technical write-up on Saturday, November 21, 2026. In their words: "A use-after-free in Ghostscript's Type 1 font loader lets a crafted document cross Ghostscript's -dSAFER sandbox, alter native path controls, and execute attacker-chosen commands as the rendering process."

The danger is in how ordinary software reaches Ghostscript. You do not have to open a PostScript file yourself. A website that makes thumbnails from uploads, a webmail client that previews attachments, or a print server can hand the file to Ghostscript automatically. "The filename ended in .pdf, but the bytes were PostScript," the write-up says, and ImageMagick and Pillow passed EPS content named .png to Ghostscript too.

Who is exposed

pwn.ai ran the exploit and got command execution in these setups:

  • Debian 13 CUPS: an anonymous print job sent to a shared queue, running as the lp user.
  • Roundcube 1.7.2, on viewing a message, where the ImageMagick converter was set up (Roundcube fixed its side separately as CVE-2026-114727).
  • WordPress Core, tracked separately as CVE-2026-65640, plus the Forminator 1.55.1 and Essential Addons for Elementor 6.7.0 plugins.
  • MediaWiki 1.46.0 with PdfHandler, DokuWiki, Mayan EDMS 4.11.5 and ResourceSpace 11.0.
  • Plesk Obsidian 18.0.79, for the components only. AppArmor blocked the shell in pwn.ai's enforced test, and they did not test a deployed Plesk server.

For a second group they reached Ghostscript but did not run a full exploit: Gradio 6.32.0, and a Google pipeline where a proof read a system file (Google fixed that path on November 10). For InvokeAI, AUTOMATIC1111, ComfyUI, Frappe/ERPNext, Home Assistant, CVAT, Paperless-ngx and django-filer, they traced the code path in source and did not run anything. Treat those as likely, not proven.

The write-up also names what did not start Ghostscript for these files: PHP GD, OpenCV, prebuilt Sharp, Jimp, Java ImageIO and Go's standard image decoders. Whether libvips does depends on how it was built.

Dates and versions

  • Fixed in Ghostscript 10.08.0, released by Artifex on Tuesday, September 8, 2026. Every earlier version is affected, according to VulnCheck's advisory.
  • CVE published Monday, November 9, 2026. VulnCheck scores it 8.5 (CVSS 4.0).
  • Ubuntu shipped fixes in USN-8949-1 on October 21. Debian 13 has a backported fix.
  • Still unfixed as of November 12, according to the vendor trackers pwn.ai checked: Debian 12, Amazon Linux 2, 2023 and the 2027 preview, and several SUSE and openSUSE lines. Check your distribution's tracker again today; that list is ten days old.
  • Not in CISA's KEV catalog. Neither pwn.ai nor VulnCheck says it has been used in attacks, and neither says it has not.

What to do

  1. Inventory. On each server, check the installed package (dpkg -l ghostscript or rpm -q ghostscript) and run gs --version. Then do the same inside every container image that converts images or documents, because those carry their own copy.
  2. Upgrade to 10.08.0, or install your distribution's fixed package. If your distribution has not shipped one, the stopgaps below are the defense until it does.
  3. Update the apps that have their own fixes: WordPress for CVE-2026-65640 and Roundcube for CVE-2026-114727. Neither primary we read gives the fixed WordPress version, so check WordPress's own release notes.
  4. CUPS: "Requiring authentication on the queue blocked the unauthenticated submission." Do not share a queue to people who have not logged in.
  5. ImageMagick stopgap (our advice, not the researchers'). If you cannot upgrade Ghostscript yet, ImageMagick's policy.xml can refuse the PS, PS2, PS3, EPS, PDF and XPS formats, which stops ImageMagick handing them to Ghostscript. That breaks PDF thumbnails, so only do it where you can live without them.
  6. Limit what the renderer can do. "A policy that prevents a renderer from starting a shell can limit what happens even after the interpreter is compromised." AppArmor or SELinux on the conversion process is what stopped the Plesk test.
  7. Check the real file type before making a thumbnail, not after. A name ending in .png proves nothing.

Am I affected?

Run gs --version on the host and inside each image-processing container. Anything below 10.08.0 without a distribution backport is vulnerable. Then ask one question of each web app: does it make previews or thumbnails of files strangers upload, using ImageMagick, Pillow or a PDF handler? If yes and Ghostscript is old, assume you are exposed. To look for attempts, search upload directories for files whose content starts with %! (PostScript) whatever their extension is, and look in your process logs for gs or ghostscript starting a shell (sh, bash) as its child.

A free checker does this inventory for you. A read-only script published today, Mahgal/upload2shell-check on GitHub, runs gs --version, reads your ImageMagick delegates and policy.xml, checks for an open CUPS queue, and looks for WordPress or Roundcube installs, then prints VULNERABLE, EXPOSED or PATCHED. We read it in full: it is Python standard library only, makes no network calls and carries no exploit code. Read it yourself before you run it, as you should with anything.

What we saw

Our harvester picked up two public repositories this morning, Sunday, November 22, at 12:01 and 12:02 UTC. We read both, and did not run either. One, Mahgal/upload2shell-check, is the read-only exposure checker described above. The other is a working exploit generator: pass it a callback domain and it writes ready-to-upload files, disguised with .pdf, .png and .jpg names, that run a command on a vulnerable server and phone home. A tool that turns the research into point-and-shoot files is public now. That raises the urgency to patch; it is still not a report of anyone being attacked. A public exploit is when the exploit went public, not a sighting in the wild.

Our edge shows 0 matches for the paths those repositories target in 741,442 edge blocks, 168,527 edge canary hits and 2,481 origin honeypot captures since September 1. Read that zero as unknown, not clean: this attack lives inside the body of an upload, and our edge records store the request path, not the file. No network indicators were published in the sources we read, so we added nothing to our feed.

Read next: PHP2Shell: The Fix Is Out. Patch PHP Today, another case where the exploit arrived before most servers had the fix.

Sources

  • pwn.ai (Paulos Yibelo), "How We Hacked the Pipes — Upload2Shell," November 21, 2026: https://pwn.ai/upload2shell/research.html and the impact index at https://pwn.ai/upload2shell
  • VulnCheck advisory, "Ghostscript before 10.08.0 -dSAFER bypass via .putgstringcopy .forceput recovery," November 9, 2026: https://www.vulncheck.com/advisories/ghostscript-before-10.08.0-dsafer-bypass-via-putgstringcopy-forceput-recovery
  • Artifex release gs10080: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/tag/gs10080
  • The Hacker News, "Researchers Demonstrate Ghostscript Sandbox-Escape RCE via Crafted File Uploads in Popular Apps," November 22, 2026: https://thehackernews.com/2026/11/researchers-demonstrate-ghostscript.html
  • Not readable by our fetcher: the Ghostscript bug tracker entry (bot challenge) and the CVE.org record (empty page). The distribution status above comes from pwn.ai's tables, not from the trackers directly.

How do AI models see YOUR brand?

AIPM has audited 250+ domains. 15 seconds. Free while still in beta.

Audit your site now → aipmsec.com


Was this useful? Thirty seconds, no cookies, no tracking, no third parties, your address hashed and never stored. The question lives here: https://analytics.dugganusa.com/nps.html#post=ghostscript-upload2shell-cve-2026-125396