The attachment was named quarterly-results.jpg and declared as image/jpeg. Its bytes were PostScript. When the recipient opened the message in Roundcube, the webmail server did what webmail servers do: it generated a thumbnail, handed the “image” to ImageMagick, and ImageMagick handed it to Ghostscript, which executed the program inside the file. The sender needed no account on the server. The recipient needed no click beyond reading their mail. The command ran as www-data, and a thumbnail was produced, so nothing looked wrong.
This was one of three front doors described in Upload2Shell, research Paulos Yibelo and his team at pwn.ai published on 17 November 2026. The other two, a public PDF upload form and an anonymous network print job, ended at exactly the same place: a use-after-free in Ghostscript’s Type 1 font loader, now tracked as CVE-2026-125396.
Ghostscript has had many memory-safety bugs before, and its maintainers would be the first to say so. What makes Upload2Shell worth reading closely is the distance between where the attacker stands and where the bug lives. Almost none of the affected applications call Ghostscript directly. They call an image library, or a thumbnail helper, or a print filter, and two or three layers down, a Turing-complete interpreter starts executing attacker-controlled code inside a sandbox that was never built to survive a corrupted interpreter. The front doors were all different. The shared dependency behind them was not.
Why rendering a PostScript file means running a program
PostScript is a programming language, not a data format, and Ghostscript is its interpreter. Rendering a PostScript file means executing whatever program that file contains; PDF rendering in Ghostscript routes through the same machinery. The -dSAFER flag exists to constrain that program, restricting file access and command execution through checks inside the interpreter itself. That’s different from a kernel sandbox: seccomp filters system calls from outside the process, while -dSAFER is enforced by the same code the untrusted document is running against. A memory-corruption bug in the interpreter isn’t a contained failure. It’s a way for the document to rewrite the rules it’s supposed to obey, the same way a V8 bug lets JavaScript corrupt the engine running it.
The history here converges on one field. In 2018, Tavis Ormandy showed that Ghostscript’s /invalidaccess privilege checks could fail under certain conditions, letting crafted PostScript bypass the sandbox. Later escapes, including CVE-2020-15900, the %pipe% command injection of CVE-2023-36664, and the uniprint format-string bug CVE-2024-29510, kept arriving at the same destination: path_control_active, a boolean in the interpreter’s global context structure that -dSAFER sets to 1 and that PostScript is never supposed to set back to 0. Codean Labs’ 2024 analysis of CVE-2024-29510 documented that field’s location in gs_lib_ctx_core_t and the pointer chain reaching it through gs_memory_t and gs_lib_ctx_t, including the offsets 208, 8, and 156 that reappear in this research. As recently as October 2026, researcher Rick de Jager published yet another bypass (CVE-2026-101258) that zeroes the same flag through a different root cause. Upload2Shell is the newest route to a well-known target, but what’s new is the beginning of the chain: an error handler, a font loader, and a lifetime rule broken across PostScript’s virtual memory spaces.
How a file upload reaches an interpreter nobody invoked
The applications in this study rarely exec gs directly. A PHP application calls Imagick::readImage(); ImageMagick identifies the file by content rather than extension, picks a format handler, and delegates PostScript and PDF rendering to Ghostscript through its delegate configuration. In the team’s WordPress-shaped proof, the call was Imagick::readImage($input . '[0]') on a file whose name ended in .pdf and whose contents were PostScript, and ImageMagick passed it straight to Ghostscript under -dSAFER.
Python behaves the same way through a different door. Pillow’s EPS plugin shells out to Ghostscript only when pixels are actually decoded: Image.open() alone just identifies the file, while load(), crop(), or a conversion starts the renderer, which means imageio.imread() and skimage.io.imread() inherit the exposure transitively. The team’s tests also reached Ghostscript through libvips’ magickload path and Qt’s KImageFormats EPS plugin (both build-dependent), and they note Ghostscript can be linked as a library, in which case no gs process ever appears for a defender to watch.
Their source audit traced the same pattern through software that would never describe itself as a document processor: image uploads in InvokeAI, AUTOMATIC1111’s img2img, ComfyUI previews, Gradio’s image preprocessing, Frappe’s upload optimization, Home Assistant’s thumbnail route, CVAT’s frame worker, and Paperless-ngx’s mail importer, which calls Ghostscript directly for PDF/A conversion. These are renderer-path and pinned-source findings rather than confirmed exploits, but that distinction barely matters operationally: the vulnerable interpreter sits behind the upload handler either way.
The exploit also needed a Type 1 font file to trigger the loader, and the team removed that requirement two different ways. In the ImageMagick delegate, the document wrote its font to the scratch output path already authorized in currentpagedevice /OutputFile. A fully self-contained variant instead used Ghostscript’s process-local %ram% device, so no pre-existing file and no host filesystem write were needed at all.

The helper function that fails at exactly the wrong moment
The bug lives in .putgstringcopy, a helper in Resource/Init/gs_fonts.ps. Ghostscript implements parts of its own font loading in PostScript, and this helper needs to write into protected font dictionaries, something ordinary document code must never do. It does the write with .forceput, an internal operator that bypasses the normal access checks. The definition, quoted in the public bug report, is short:
📬 Stay Ahead of Cyber Threats
Get the latest cybersecurity news, critical vulnerabilities, threat intelligence, tutorials, and exclusive giveaways delivered straight to your inbox. No spam. Unsubscribe anytime.
postscript
/.putgstringcopy{ 2 index gcheck currentglobal 2 copy eq { pop pop .forceput } executeonly { 5 1 roll setglobal dup length string copy .forceput setglobal } executeonly ifelse} .forcebind odef
The helper is bound and marked executeonly, so a document can’t inspect or redefine its body. But those properties protect the code, not the execution. In the branch taken when the destination dictionary’s VM space differs from the current one, the helper switches allocation mode with setglobal, then runs dup length string copy to allocate a string and copy the source into it, and only then performs the privileged .forceput. Nothing validated that the operands were actually strings. The team credits the discovery of this gap to GPT 5.6 Sol working with Yibelo; the bug was reported to Artifex on 1 September 2026 with a working proof.
Here’s the actual attack. It registers a Type 1 font in Fontmap and loads it with findfont. The font describes an ordinary Courier-derived face, but Type 1 loading executes PostScript, and that code can see the font loader’s operand stack. It replaces the filename string on the stack with a local array. In the global-to-local branch, length succeeds on an array and string allocates normally, but copy then raises typecheck because its source is an array, not a string. That error is catchable, and the document installs its own handler in errordict, which is where the sandbox comes apart:
postscript
errordict /typecheck { userdict /LoaderTrapPhase known { userdict /LoaderTrapPhase get } { false } ifelse { userdict /LoaderTrapPhase false put pop pop pop pop pop userdict /ForceTarget get userdict /ForceKey get userdict /ForceValue get } { LoaderOriginalTypecheck } ifelse} bind put
The five pops discard the failing copy, the freshly allocated destination string, the substituted filename, the loader’s /PathLoad key, and the font dictionary, leaving the saved allocation-mode boolean on the stack. The handler pushes an attacker-chosen dictionary, key, and value on top of it, then returns normally. Because the helper’s body is a bound procedure already mid-execution, interpretation resumes at the next element: the pending .forceput. It stores the attacker’s value into the attacker’s dictionary with full privilege, and setglobal consumes the leftover boolean as if nothing had happened. The document never calls the hidden operator directly. It just survives an error at the exact point where the interpreter was holding privilege on its behalf.
Ken Sharp, Ghostscript’s maintainer, confirmed the mechanism and committed a fix validating operand types the next day. He described .forceput in the bug tracker as “an ancient piece of code well known to be a vulnerability, but difficult to eradicate.”
From dictionary write to a dangling pointer
A protected-dictionary write is a sandbox problem, not yet native code execution. The escalation abuses a second, independent rule. PostScript splits composite objects into local and global virtual memory: save records the state of local VM, and restore discards everything allocated locally since that save, while global objects survive. The safety invariant is that a surviving global or protected dictionary must never hold a usable reference to a local object that restore will reclaim.
The recovered .forceput breaks exactly that invariant, with the interpreter’s cooperation. The bug report shows that zforceput() in psi/zgeneric.c temporarily treats systemdict as local while calling idict_put(), then restores its space flags, so a post-save local composite passes the store check into a dictionary that will outlive it.
After restore, the protected dictionary still holds its reference, but the storage behind it has been freed. The team first demonstrated the consequence with a small probe: force an 8-element local array into systemdict, restore, allocate a replacement array, write 5151 through the stale systemdict reference, and read it back from the replacement. When the allocator reuses the freed block, both references point at the same bytes.
The native proof scales the idea up: a dangling 2,048-byte string, then 512 fresh arrays of 32 integer references, each one holding the marker 0x12345678. Scanning the stale string for the marker’s little-endian bytes, flipping one occurrence from 0x78 to 0x79, and finding which live array element became 0x12345679 identifies the exact overlapping reference slot. No heap address is guessed anywhere; the exploit locates itself through the allocator’s own reuse. That’s why the report’s validation matrix shows it passing on freshly started processes across builds and architectures: 10 of 10 runs on official 10.07.1 for macOS arm64, and 20 of 20 on a 10.05.0 Linux x86-64 build.
On the tested 64-bit build, a Ghostscript ref occupies 16 bytes: eight for type, attributes, and size, then eight for the value or pointer. That layout turns the overlap into a precise instrument. The exploit saves a complete valid reference for later cleanup, keeps a writable string’s header as a template, and places currentdevice in the overlapping slot. Reading the device reference’s genuine pointer through the dangling string, then rewriting the live reference as a temporary string view over that pointer, gives byte-granular read and write access to native memory, with the interpreter’s own objects supplying every address. The team restored the forged reference to its original integer form before touching anything else, so the corrupted view never survives into garbage collection or teardown.

Walking the interpreter’s own pointers to find the kill switch
With a byte view over a genuine device pointer, the exploit follows a fixed chain of structures to the sandbox’s enforcement state:
text
ref +8: value.pdevice → psi_device_refpsi_device_ref +0: device → gx_devicegx_device +24: memory → gs_memory_tgs_memory_t +208: gs_lib_ctx → gs_lib_ctx_tgs_lib_ctx_t +8: core → gs_lib_ctx_core_tgs_lib_ctx_core_t +156: path_control_active
The offsets are specific to the tested x86-64 build, but they aren’t novel guesses: the tail of this chain, gs_memory_t at 208 to gs_lib_ctx, 8 to core, 156 to path_control_active, matches what Codean Labs documented independently back in 2024. This structure layout has been stable attack-surface knowledge for years. And because every address came from a live interpreter reference rather than a fixed image base, ASLR never entered the picture.
To prove the primitive amounted to native control rather than clever bookkeeping, the team performed a reversible edit on an operator. They copied the full 16-byte reference for mul, obtained a genuine sub reference, and overwrote only the eight pointer bytes at offset 8 in the live mul reference: a C function-pointer change, not a PostScript redefinition. The rendered page recorded 29 11 mul returning 319 before the write, 18 while it was in place (29 minus 11), and 319 again after the original bytes were copied back, alongside markers NATIVE_POINTER_OVERWRITE_MATCHED=true and NATIVE_DISPATCH_RESTORED=true.
The public proof of concept is a 104-line self-contained PostScript file that stages its font in %ram%, runs this sequence, and exits without touching host files or starting a process. It reproduced in five fresh processes on Ghostscript 10.07.0 for x86-64 Linux, and on the fixed 10.08.0 build it fails early, at the dangling-reference lookup, before any pointer is written. For most vendor reports the team used a simpler demonstration instead: reading /proc/version and returning its contents in the output, which proved the file-access boundary had been crossed without going as far as demonstrating native dispatch.
Three separate locks, not one famous flag
Disabling -dSAFER from native memory turned out to require more than flipping the one famous flag, and the writeup is unusually honest about this. The decisive write is four PostScript put operations on the forged string view over gs_lib_ctx_core_t:
postscript
Target 156 0 putTarget 157 0 putTarget 158 0 putTarget 159 0 put
The proof read 1,0,0,0 at those bytes before the write and 0,0,0,0 after, and the interpreter’s own .currentpathcontrolstate operator then reported false, while -dSAFER remained on the command line the whole time. But path control is only one of three gates. The PostScript-side PermitFileWriting list still had to allow the target, which the team set to [ (*) ] using the recovered .forceput alone, no memory corruption needed. And for %pipe% filenames, parse_file_name() consults a cached native copy of the LockFilePermissions flag; the exploit loaded the font a third time, force-wrote that protected user parameter to false, and used a save/restore cycle to sync the cached value with the parameter.
Only then does command execution become a formality. The bounded Debian print-job proof ended with this block:
postscript
(PIPE_RCE_STOPPED=) print{ (%pipe%printf POST_SAFER_UAF_PIPE_RCE > /var/tmp/GS_CUPS_PIPE_RCE) (w) file closefile} stoppeddup ==
Opening a %pipe% filename for writing spawns a shell command. stopped returned false, meaning the block completed without error, and the marker file appeared on the print server. The command ran as uid=7(lp), the renderer’s account, not the submitter’s. That distinction sets the impact ceiling everywhere in this research: the attacker inherits the rendering process’s authority, which on a web server is www-data, in a document container an application user, and on a print server the lp account. Whatever that account can read, write, or execute, the document can too.
Where this actually shows up: Roundcube, WordPress, and a print queue
The Roundcube chain (tested on 1.7.2 with Ghostscript 10.07.1) is the quietest of the three: an external sender emails the disguised attachment, an authenticated recipient views the message, and server-side thumbnailing does the rest. It worked five for five in their trials, with a permissive ImageMagick delegate policy as the only precondition.
The WordPress chains split into authenticated and anonymous variants. In Core, the upload_files capability held by Authors and above was enough, because PDF preview generation enters the Imagick pipeline; WordPress shipped its own mitigation, CVE-2026-65640, in 7.0.4 on 12 August, with backports including 6.9.7, and its advisory described remote code execution on sites using Imagick and Ghostscript. Plugins removed even the login requirement: a public Forminator PDF field configured to store uploads in the Media Library triggered attachment-metadata generation, and Essential Addons for Elementor’s public registration widget offered another upload field, both ending in command execution as the web-service user.
The team also demonstrated paths through MediaWiki’s PdfHandler on a wiki permitting anonymous uploads, DokuWiki with its optional ImageMagick backend, Mayan EDMS importing email from a configured POP3 source into its worker container, ResourceSpace’s preview worker, and Plesk’s bundled Roundcube running as roundcube_sysuser.
The Debian 13 case needs no web application at all. An IPP Print-Job sent to a shared network queue that accepts jobs without authentication reaches gstopdf, which starts the distribution’s Ghostscript with -dSAFER. The full chain ran on Ghostscript 10.05.1~dfsg-1+deb13u1 and executed the marker command as lp. Requiring authentication on the queue blocked the unauthenticated submission, a one-line policy change standing between a network-reachable print server and this exploit.
One detail the original blog post underplays: Google independently confirmed the same root cause in a signed-out document-viewer path running Ghostscript 10.05.0, where a single attacker-hosted document produced native dispatch and a bounded read of the worker’s /proc/version. It was Google asking whether the issue had already been reported upstream that prompted the Artifex disclosure. The broader research also reached Dropbox and several redacted production services through separate Ghostscript findings, each earning the respective program’s maximum bounty; those are distinct bugs and their writeups are still pending.
The scoring deserves its own paragraph. The Ghostscript CVE carries CVSS 4.0 base 8.5 with a local attack vector (AV:L, passive user interaction, no privileges required), and VulnCheck classifies the weakness as CWE-648, incorrect use of privileged APIs. That rating describes the interpreter flaw in isolation. The demonstrated delivery paths, an email, an HTTP form, a network print job, are remote by any operational definition, and the team argues the local vector undersells how the bug actually gets reached in practice. Both things are true at once: the CVE scores the component, and the component sits behind remote attack surface in product after product. Treating the vector letter as a deployment risk assessment is the mistake this research exists to correct.

The fix, and why patching is more complicated than it sounds
Artifex’s response was quick and layered. Sharp’s 2 September fix validates operand types before copy can fail, closing the error-recovery path. A follow-up change moved the helper into C and removed its dependence on .forceput entirely, part of a longer campaign he described in the fix itself: “it isn’t easy to undo 30 years worth of assumptions in the code.” The public fix commit, 1484854e0c8d, shipped in Ghostscript 10.08.0, released on 8 September 2026.
The distribution story since then has been uneven in ways that matter more than the patch itself. Debian’s DSA-6516-1 on 25 September fixed Trixie at 10.05.1~dfsg-1+deb13u2 (the current security build is +deb13u3), and unstable and testing moved to 10.08.0~dfsg packages. Ubuntu’s USN-8949-1 on 21 October covered seven releases, from 26.10 down to 16.04 via Pro and Legacy add-ons, and because it predates the CVE assignment, it lists Yibelo’s operand-validation finding with the label “(No CVE number),” alongside de Jager’s separate CVE-2026-101258. When the writeup’s vendor survey ran on 12 November, Debian 12 Bookworm was still listed vulnerable, Amazon Linux showed a pending fix, and several SUSE branches were affected or in QA. The Debian tracker now shows a fixed Bookworm LTS package, 10.0.0~dfsg-11+deb12u9, via DLA-4914-1, which lands after the article’s snapshot.
Two things fall out of that inventory. First, version numbers lie in both directions: a 9.55.0 package on Ubuntu 22.04 contains the backported fix, while a freshly updated host can sit beside a container image or application bundle carrying its own vulnerable Ghostscript that no host package manager will ever touch. The question is never “is the OS patched” but “which binary does this service actually load.” Second, a distribution shipping a fix for some other recent Ghostscript CVE, and there were several in 2026, including the Wordfence-reported heap overflow CVE-2026-39919 fixed in the same 10.08.0 release, doesn’t establish that this specific one is fixed on the branches you run. Inventory renderers per service, not per host.
What the chain actually teaches you
Every layer in this story made an assumption that the next layer down quietly violated. The font loader assumed its bound, hidden helper couldn’t be interrupted into handing privilege to a document. .forceput assumed its callers would respect VM lifetimes. The applications assumed that accepting a .jpg or .pdf at the upload handler said something about what would process it. And defenders assumed a CVSS local vector meant local exposure.
The Roundcube ordering lesson is the cleanest application-side fix in the whole writeup: checking a file’s real type after generating its thumbnail gives the interpreter first refusal on attacker bytes, and no downstream patch changes that ordering. Validating content before rendering, disabling PostScript and EPS coders in ImageMagick policy where the feature isn’t needed, requiring authentication on shared print queues, and confining renderers so a compromised interpreter meets a kernel boundary instead of the open filesystem all interrupt the chain at points the interpreter’s own patch can’t reach. WordPress mitigated in August, a month before the upstream release, precisely because it controlled its own seam.
The timeline is worth keeping whole: WordPress’s mitigation on 12 August, Artifex’s fix authored 2 September and released 8 September, the completed Debian network proof on 17 September, the CVE published in early November, and the full writeup on 17 November, with a Debian CUPS case study promised as the first of a series. More application paths will surface, because the place to look is never the upload handler itself but everything that happens after a file is accepted: thumbnailing, metadata extraction, document import, print conversion. Each of those steps hands attacker-controlled bytes to a process with authority the sender never had. Upload2Shell didn’t invent that arrangement. It just showed, with a 104-line PostScript file and a freed string, what the arrangement has been worth all along.







