Subscribe
0%
Illustration for: Upload2Shell (CVE-2026-125396): a Ghostscript bug turns crafted uploads into code execution. Update to 10.08.0 or your distro fix

Upload2Shell (CVE-2026-125396): a Ghostscript bug turns crafted uploads into code execution. Update to 10.08.0 or your distro fix

A use-after-free in Ghostscript's font loader lets a booby-trapped document switch off its -dSAFER sandbox and run commands, and researcher Paulos Yibelo says he reached it through uploads in WordPress, Roundcube, a Debian print queue and seven other products. Ghostscript 10.08.0 fixed it in September, but many servers still run older builds.

Listen to this article0:00 / 6:28

A Ghostscript flaw now branded "Upload2Shell" lets a crafted document run commands on the server that renders it. Researcher Paulos Yibelo of pwn.ai says he got there through ordinary upload and preview features in 10 products, including WordPress, Roundcube webmail and Debian 13's shared CUPS print queue, according to pwn.ai's disclosure page. The bug, CVE-2026-125396, was fixed in Ghostscript 10.08.0 on September 8. The full write-up went public late last week.

Why it matters: Ghostscript runs quietly behind a lot of software. ImageMagick hands PostScript, EPS and PDF files to it, and so do thumbnailers, document managers and print servers. The file only has to look like a PDF or an image, iTnews reports. Distributions also backport fixes without changing the version string, so the version number alone won't tell you whether a server is safe.

What the bug is

Security firm Ostorlab's analysis traces the bug to a use-after-free in the Type 1 font loader. A routine in Resource/Init/gs_fonts.ps passes operands it hasn't checked to the privileged .forceput operator. A crafted file can use that to turn off the native path controls behind -dSAFER, Ghostscript's sandbox mode, and then run commands as the user doing the rendering. iTnews calls it the latest variant of a recurring class of -dSAFER escapes.

Detail
CVE CVE-2026-125396
Affected Ghostscript before 10.08.0 (unless your distro backported the fix)
Fixed 10.08.0, released Sept 8, 2026
Severity CVSS v4.0 8.5 (High), per Ostorlab and GBHackers citing the CVE record. The Hacker News ties the score to a VulnCheck-linked advisory
Exploited in the wild? None reported. Not in CISA's KEV catalog as of Nov 21, per Ostorlab
Public PoC One public file shows the memory corruption but doesn't spawn a shell, per The Hacker News and Ostorlab. iTnews says it reproduced the PoC on an older build

pwn.ai's timeline: discovery on July 27, a report to Artifex (bug 709684) by early September, the CVE requested November 6 and published November 9. Google closed its production path on November 10. iTnews says Yibelo found the bug with AI help and that Dropbox and five other organisations paid maximum bug bounties, worth "low six figures" in total by his account. pwn.ai counts the Dropbox finding and four redacted ones as separate Ghostscript bugs.

Where it was reached

pwn.ai lists 10 confirmed paths and nine more it mapped from source code but didn't demonstrate:

  • Confirmed: Debian 13 CUPS (shared print queue), Roundcube, the Forminator and Essential Addons for Elementor WordPress plugins (public upload forms), WordPress Core, MediaWiki with PdfHandler, DokuWiki, Mayan EDMS, ResourceSpace, Plesk.
  • Mapped from source only: Gradio, InvokeAI, AUTOMATIC1111, ComfyUI, Frappe, Home Assistant, CVAT, Paperless-ngx, django-filer.

Several of these need more than a public form. In WordPress Core, someone with upload rights (Author level, or a Contributor granted upload_files) has to upload the file, GBHackers notes. WordPress patched its side as CVE-2026-65640 in 7.0.4, and pwn.ai lists a Roundcube fix as CVE-2026-114727. A Hacker News commenter argued that the "upload" branding oversells it: the flaw is in Ghostscript, not in any upload control.

What to do

  1. Patch Ghostscript. Install 10.08.0, or your distro's backported package. Ostorlab lists Debian 13 fixed in 10.05.1~dfsg-1+deb13u2 and Debian 12 in 10.0.0~dfsg-11+deb12u9. pwn.ai points to Ubuntu's USN-8949-1 from October 21. The Hacker News says Debian 12 still appeared vulnerable when it checked, that Amazon Linux fixes were pending and that SUSE was affected or in progress, so check your vendor's tracker before you rely on any one table.
  2. Update the apps in front of it. Move to WordPress 7.0.4 and the fixed Roundcube release.
  3. Find out what calls Ghostscript. Ostorlab suggests magick -list delegate | grep -i -E 'gs|ghostscript' to see ImageMagick's delegate. Remember that some software links the Ghostscript library directly.
  4. Stop rendering what you don't need. If you don't need PostScript, EPS or PDF previews, block them. A common ImageMagick policy.xml setup (our example, adjust to your needs) is <policy domain="delegate" rights="none" pattern="gs" /> plus <policy domain="coder" rights="none" pattern="{PS,PS2,PS3,EPS,PDF,XPS}" />. Our Rails Active Storage guide covers a similar lockdown.
  5. Sandbox the renderer. Run it as an unprivileged user under seccomp or AppArmor. The Hacker News says AppArmor blocked a shell in one test.
  6. Require login on shared CUPS queues, and check the file's real type before you generate thumbnails.
  7. Hunt for traces. Ostorlab suggests grepping spools and upload directories for %pipe%, for example grep -R -l -a '%pipe%' /var/spool/cups /srv/uploads.

Caveats

pwn.ai's own page doesn't list a CVSS score or say how the bug was found, and we couldn't read the Debian security tracker or pwn.ai's full technical write-up. Sources disagree on Debian 12's status, and Daily CyberSecurity names Google Docs, Drive, Chat and Gmail processing where pwn.ai names no Google products. There are no reports of attacks yet. With a write-up and partial PoC now public, that may not last long.

Sources

  1. pwn.ai — Upload2Shell · CVE-2026-125396 pwn.ai
  2. Ostorlab — Upload2Shell: Ghostscript Sandbox Escape to RCE (CVE-2026-125396) blog.ostorlab.co
  3. The Hacker News — Researchers Demonstrate Ghostscript Sandbox-Escape RCE via Crafted File Uploads in Popular Apps thehackernews.com
  4. iTnews — AI-found Ghostscript flaw turned file uploads into remote code execution itnews.com.au
  5. GBHackers — Ghostscript Upload2Shell Flaw Exposes WordPress Sites to Remote Code Execution via ImageMagick gbhackers.com
  6. Daily CyberSecurity — Ghostscript Remote Code Execution (CVE-2026-125396): PoC Published securityonline.info

#Ghostscript#CVE-2026-125396#Upload2Shell#ImageMagick#WordPress#Roundcube#vulnerability