AI-found Ghostscript flaw turned file uploads into remote code execution

By

Upload2Shell sandbox escape details and PoC published over weekend.

Key points

  • A Ghostscript flaw dubbed Upload2Shell lets attackers disguise PostScript as a PDF, JPG or PNG to run commands on a server, and Paulos Yibelo of pwn.ai found it with the help of AI.
  • Tracked as CVE-2026-125396, the bug affects unpatched Ghostscript builds before version 10.08.0, which Artifex released on 8 September, and pwn.ai confirmed command execution in 10 products including Debian 13 and Roundcube webmail.
  • Dropbox and five other organisations paid Yibelo the maximum bug bounty, amounting to low six figures in total, and no exploitation in the wild has been reported.
AI-found Ghostscript flaw turned file uploads into remote code execution

A flaw in Ghostscript, the open-source interpreter that renders PostScript and PDF files for preview and printing across many web services, let attackers run commands on a server by disguising a document as an image.

Paulos Yibelo of pwn.ai found the vulnerability with the help of artificial intelligence (AI), and it is a variant of a class of Ghostscript sandbox escapes that keeps recurring.

Artifex is the company that maintains Ghostscript and it fixed a related flaw in the same font-handling file in 2018 found by Google researcher Tavis Ormandy through fuzzing.

The company said it is trying to remove the privileged internal operation that keeps making the class of bugs possible.

The vulnerability was named Upload2Shell by Yibelos.

The vulnerability is tracked as CVE-2026-125396 and affects unpatched Ghostscript builds before version 10.08.0 which was released in September.

The version number alone can mislead, because Linux distributions often backport the fix while keeping an older version string.

Desktop systems are less exposed than web services which automatically process PDF and PostScript files from untrusted sources.

iTnews was able to replicate pwn.ai's proof-of-concept using an earlier, vulnerable version of Ghostscript, comparing the output of the interpreter to the patched 10.08.0 one that didn't trigger the flaw.

PostScript is a programming language as well as a page format; it means Ghostscript runs a PostScript file as a program rather than reading it like a picture.

An ordinary PDF cannot carry the code the attack needs, so the exploit hides PostScript inside files named .pdf, .jpg or .png.

Image libraries such as ImageMagick and Pillow decide how to handle a file by its contents rather than its name and pass the PostScript to Ghostscript to process.

"Almost every application we tested with file uploads could be tricked into passing a file with a trusted extension to Ghostscript," Yibelo wrote.

Ghostscript's -dSAFER sandbox is meant to stop a document touching files or running commands, but the crafted file breaks a font-loading routine and uses its own error handler to switch the protection off in memory.

pwn.ai said it confirmed command execution in 10 products.

On Debian 13, an anonymous print job sent to a shared queue ran on the host, and on Roundcube webmail, merely viewing an email with a disguised attachment was enough.

Visitors who were not signed in could reach the flaw through public upload fields in the Forminator and Essential Addons for Elementor plugins for WordPress.

WordPress rated its own fix 8.8 out of 10 for sites running the Imagick and Ghostscript combination.

Google's document pipeline could be reached with a signed-out request for an attacker-hosted file, and pwn.ai said Google closed that path on November 10.

A pwn.ai teaser in September also named Meta, Zoom and Box, but none of them appear in the firm's published report.

The firm said its Dropbox finding and several unnamed others were separate Ghostscript bugs.

WordPress shipped its mitigation on August 12, and Artifex released Ghostscript 10.08.0 on September 8.

pwn.ai requested the CVE on November 6, and it was published on November 9 US Eastern time, more than two months after the fix.

No exploitation of Upload2Shell in the wild has been reported, though pwn.ai published a working proof of concept alongside the disclosure.

The useful place to look for more of these flaws, Yibelo said, is the processing that follows an accepted file: thumbnail generation, metadata extraction, document import and print conversion.

Dropbox and five other organisations awarded Yibelo with the maximum bug bounty for finding and reporting the Upload2Shell flaw.

Asked how much the bounties amounted in total, Yibelo told iTnews that "I can't say the exact amount but it's in the low six figs [figures]".

Add iTnews as your trusted source

Got a news tip for our journalists? Share it with us anonymously here.
Copyright © iTnews.com.au . All rights reserved.
Tags:

Most Read Articles

Coles Group investigating a cyber incident

Coles Group investigating a cyber incident

Hijacked website testing tool plants card skimmer on Australian brands’ sites

Hijacked website testing tool plants card skimmer on Australian brands’ sites

Nginx servers rootable through critical flaws, unpatched Linux kernel bug

Nginx servers rootable through critical flaws, unpatched Linux kernel bug

Kernel-crashing NoisyTCP bug sat in Linux for 11 years

Kernel-crashing NoisyTCP bug sat in Linux for 11 years

Log In

  |  Forgot your password?