Upload2Shell Is Scored as a 'Local' Bug but Was Exploited Over the Network in Tests: The Ghostscript Flaw Shows CVSS Can't See Your Upload Pipeline

2026-11-23 · By Reef Administrator - H.A

Upload2Shell Is Scored as a 'Local' Bug but Was Exploited Over the Network in Tests: The Ghostscript Flaw Shows CVSS Can't See Your Upload Pipeline

Upload2Shell Is Scored as a 'Local' Bug but Was Exploited Over the Network in Tests: The Ghostscript Flaw Shows CVSS Can't See Your Upload Pipeline

Ghostscript's CVE-2026-125396 carries a local attack vector, yet researchers turned it into remote command execution through WordPress, Roundcube, CUPS and MediaWiki, and ten weeks after the fix, several major Linux distributions still list it as pending.

A bug that almost nobody calls directly

Most teams would say they don't run Ghostscript. Many of them do anyway. The PostScript and PDF interpreter sits underneath ImageMagick, Pillow, libvips, CUPS and many document-preview tools. When an application crops an avatar, makes a thumbnail of an email attachment or previews an uploaded PDF, the file may end up inside Ghostscript without the application ever running a gs command.

That hidden dependency is what makes CVE-2026-125396, which its finders call "Upload2Shell", worth looking at beyond the usual "patch now". According to the CVE record, Ghostscript before 10.08.0 has a flaw in the .putgstringcopy procedure in gs_fonts.ps. The procedure calls the privileged .forceput operator without checking what it is given. A crafted PostScript or PDF document can trigger a type error, get hold of .forceput through a custom error handler, and cause a use-after-free across save/restore. The result is code execution outside the -dSAFER sandbox that is supposed to contain hostile documents.

The researchers describe it as a use-after-free in Ghostscript's Type 1 font loader that gave them a write-what-where primitive. They used it to change the state that enforces -dSAFER and then run commands as whatever account does the rendering.

The score says "local"; the case studies say otherwise

The CNA rated the flaw CVSS 3.1 7.8 and CVSS 4.0 8.5, both with a Local attack vector and user interaction required. Debian, Ubuntu, SUSE and Amazon Linux all copied those vectors. Read literally, that says an attacker needs a victim to open a file on their own machine.

The researchers' disclosure timeline describes something quite different. They say they confirmed:

WordPress fixed its own path separately on 12 August. Its advisory scores that path at Network, low privileges, CVSS 8.8, for any user with the upload_files capability on servers using Imagick and Ghostscript.

Both scores can be right. CVSS describes the vulnerable component, and Ghostscript on its own really does just process a local file. But in practice nobody exploits Ghostscript on its own; attackers reach it through whatever feeds it files. A vulnerability management programme that sorts by the base vector will push a "Local, UI:R" library bug below a stack of network-facing mediums. For any server that renders untrusted uploads, that order is backwards.

The file extension is not a control

The technical write-up makes a second uncomfortable point: renaming doesn't protect you. In the researchers' tests, EPS content saved as .png still reached Ghostscript through Pillow's Image.load() and crop(), through imageio and scikit-image, through PHP's Imagick::readImage() and, depending on the build, through libvips and Qt image plugins. The decoders looked at the bytes, not the name. The researchers also say they found image-decoding calls in the upload paths of popular AI image tools such as InvokeAI, AUTOMATIC1111 and ComfyUI.

So an allow-list of extensions at the upload form, the most common "secure upload" advice, does nothing here. What matters is which decoders are installed and enabled on the server that processes the file.

A quiet fix and a slow patch cycle

The timeline also explains why so many systems are still exposed. According to the researchers, they reported the bug to Artifex by early September, and Ghostscript 10.08.0 shipped on 8 September with the fix. The CVE was published on 9 November, and the full public write-up followed on 21 November.

That gap has already drawn criticism on the oss-security mailing list. One participant argued that the vulnerability should be treated as public from the date the fix shipped, and said the coordination "leaves much to be desired". The same post questioned how much of the attention is being driven by the PR teams of AI-driven vulnerability discovery firms. Either way, defenders lost information they needed: a fix released without an identifier doesn't show up in scanners or patch dashboards, so most organisations had no reason to upgrade until November.

Ten weeks later, the distribution trackers are still uneven when checked on 23 November:

Backports also mean that version numbers can mislead. A Debian 13 system on 10.05.1 can be fixed, while a container that someone built from upstream 10.07.0 is not.

The CVE has a public write-up and proof-of-concept repositories are circulating. CISA's enrichment data on the record still showed "Exploitation: none" when it was last updated, and the flaw is not in the KEV catalogue. With working detail now public, that window probably won't stay open for long.

Practical takeaways

gs --version 2>/dev/null
dpkg -l ghostscript 2>/dev/null | tail -1
rpm -q ghostscript 2>/dev/null
convert -list delegate 2>/dev/null | grep -Ei 'gs|ghostscript'

Sources

REEF SENTINEL