Ghostscript "Upload2Shell":one uploaded file can run commands on your server, exploit code is public
Published
CVE-2026-125396 lets a crafted file escape Ghostscript’s sandbox and run commands. Researchers showed it through WordPress uploads, Roundcube webmail and CUPS printing. Exploit code is public. Update Ghostscript to 10.08.0 or your fixed package.
Ghostscript is the PDF and PostScript engine hiding behind a lot of everyday software: image thumbnails, document previews, PDF uploads and print servers. CVE-2026-125396, nicknamed Upload2Shell, lets a crafted document break out of Ghostscript's -dSAFER sandbox and run commands as the program that opened it (CVE record). On 21 November researchers at pwn.ai published how they did it through ordinary file uploads, email and printing (pwn.ai), and exploit code appeared on GitHub the next day.
The file does not have to look like a PDF. pwn.ai showed files named .png or .jpg reaching Ghostscript through image libraries (pwn.ai).
Who is affected
- Ghostscript before 10.08.0 (CVE record). Rated 8.5 out of 10 (CVSS v4.0) and 7.8 (CVSS v3.1) by VulnCheck, the CVE's publisher (CVE record).
- Anything that hands files to it. pwn.ai confirmed command execution through (pwn.ai):
- WordPress on servers with Imagick and Ghostscript, by any user allowed to upload (Author and above by default), and with no login through public upload fields in Forminator and Essential Addons for Elementor where those were set up
- Roundcube webmail, including the copy shipped with Plesk: an outside sender's attachment ran when the email was viewed, without being clicked (needs a permissive ImageMagick setup)
- CUPS print servers on Debian 13 with a shared queue that accepts jobs without a login
- MediaWiki, DokuWiki, Mayan EDMS and ResourceSpace
- Linux packages. Distributions backport the fix into older version numbers, so the version alone doesn't tell you. pwn.ai warns that a recent update for another Ghostscript CVE does not prove this one is fixed (pwn.ai).
What has been seen so far
A snapshot from 23 November:
- Working exploit generators were published on GitHub on 22 November (9bie/CVE-2026-125396-bomb, dinosn/upload2shell-poc-generator), the second covering Ghostscript 9.26 to 10.07.1.
- Google fixed an affected path in its own document processing on 10 November (pwn.ai).
- No attacks reported yet. It is not in CISA's Known Exploited Vulnerabilities catalog, and CIRCL's Vulnerability-Lookup shows proof-of-concept posts but no exploitation report.
- Ghostscript 10.08.0 shipped the fix on 8 September, but CVE-2026-125396 was only linked to it when pwn.ai published on 21 November, and the disclosure has drawn criticism (oss-security).
What to do
- Update Ghostscript to 10.08.0 (Ghostscript, bug 709684) or your distribution's fixed package: Debian 13
10.05.1~dfsg-1+deb13u2, Debian 1210.0.0~dfsg-11+deb12u9(Debian), Ubuntu's USN-8949-1 packages. Container images need rebuilding too. - Update WordPress to 7.0.4 or the latest release on your branch (fixes back to 4.7) for the separate WordPress fix, CVE-2026-65640 (WordPress, CVE record). Review public upload fields in forms plugins.
- Update Roundcube to 1.6.20 or 1.7.5, which stop passing SVG and EPS files to ImageMagick (CVE-2026-114727) (Roundcube, CVE record).
- Print servers: require a login on shared CUPS queues. pwn.ai says that blocked the no-login route (pwn.ai).
- Website, webmail or Plesk/cPanel hosted for you? Ask your host or agency whether their Ghostscript is patched for CVE-2026-125396.
How we can help
Not sure where Ghostscript runs in your business? Get in touch.
Sources
- CVE record: CVE-2026-125396
- pwn.ai: Upload2Shell (CVE-2026-125396) timeline and affected applications
- pwn.ai: How We Hacked the Pipes, Upload2Shell technical writeup (21 November 2026)
- Ghostscript: release history (10.08.0, 8 September 2026)
- Ghostscript Bugzilla: bug 709684
- Debian security tracker: CVE-2026-125396
- Ubuntu: USN-8949-1 Ghostscript vulnerabilities
- WordPress: WordPress 7.0.4 release
- CVE record: CVE-2026-65640 (WordPress)
- Roundcube: security updates 1.6.20 and 1.7.5
- CVE record: CVE-2026-114727 (Roundcube)
- GitHub: 9bie/CVE-2026-125396-bomb
- GitHub: dinosn/upload2shell-poc-generator
- oss-security: Ghostscript 10.08.0 fixes multiple CVEs, including "upload2shell"
- The Hacker News: Researchers demonstrate Ghostscript sandbox-escape RCE
- CIRCL Vulnerability-Lookup: CVE-2026-125396
- CISA: Known Exploited Vulnerabilities catalog