Upload2Shell: a Ghostscript flaw turns ordinary uploads into remote code execution
Security researchers at pwn.ai have disclosed Upload2Shell, a Ghostscript sandbox escape tracked as CVE-2026-125396, showing how a crafted document can run code on print, email and web servers that render it — even when the file looks like an ordinary image.
The flaw, tracked as CVE-2026-125396 and rated 8.5 (High) under CVSS 4.0, is a use-after-free in Ghostscript's Type 1 font loader. A crafted PostScript or PDF document can recover the privileged .forceput operator and break out of Ghostscript's -dSAFER sandbox, gaining the ability to run attacker-chosen commands as the rendering process. Artifex fixed the bug in Ghostscript 10.08.0, released on September 8, and the CVE record lists every earlier release as affected.
What makes the flaw dangerous is how widely Ghostscript sits behind everyday features. In tests published on November 17, pwn.ai confirmed code execution through a Debian 13 print queue, Roundcube webmail thumbnails, and signed-out upload forms in WordPress plugins, MediaWiki and DokuWiki — in several cases with no login at all. Because Ghostscript also runs underneath ImageMagick and Pillow, a file named .png or .jpg can still reach the vulnerable renderer. Google fixed its own document-processing path on November 10, and most major Linux distributions have shipped fixed builds, but patch gaps remain: as of November 22, Amazon Linux still listed no fix and Debian 12 remained vulnerable.
