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:
- Unauthenticated remote command execution on Debian 13 by sending an IPP print job to a shared CUPS queue, with the commands running as
lp. - Remote execution in Roundcube when an external sender's attachment was thumbnailed as the email was viewed (as
www-data), and the same path in the Roundcube build shipped with Plesk Obsidian. - Unauthenticated execution through public upload fields in the Essential Addons for Elementor and Forminator WordPress plugins.
- Command execution in MediaWiki's PdfHandler on wikis that allow anonymous PDF uploads, in DokuWiki's optional ImageMagick backend, in Mayan EDMS email inboxes and in ResourceSpace preview workers.
- A production route into a Google document-rendering pipeline that was reachable without signing in, which the researchers say Google mitigated on 10 November.
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:
- Debian: fixed in trixie security (
10.05.1~dfsg-1+deb13u2via DSA-6516-1, current build deb13u3), in bookworm security (10.0.0~dfsg-11+deb12u9via DLA-4914-1) and in sid (10.08.0). - Amazon Linux: Amazon Linux 2, 2023 and the 2027 preview all show "Pending Fix".
- SUSE: overall state "Pending", with only openSUSE Tumbleweed showing a fixed
10.08.0package. - Ubuntu: the CVE page lists every supported release as "Needs evaluation", but the researchers say USN-8949-1 in October already contained their fix. Check your installed package against the USN rather than relying on either status alone.
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
- Find Ghostscript where it is installed, not only where it is called. Check every web, mail, print and preview host, including container images. If it is installed and anything renders user files, treat the host as in scope.
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'
- Upgrade to Ghostscript 10.08.0 or a vendor build marked fixed (Debian's DSA-6516-1 / DLA-4914-1, Tumbleweed 10.08.0). On Amazon Linux and SUSE Linux Enterprise, where fixes are still pending, apply the controls below in the meantime.
- Turn off PostScript-family decoding you don't need. In ImageMagick's
policy.xml, deny thePS,PS2,PS3,EPS,EPI,EPSF,EPSI,PDFandXPScoders on servers that only handle photos. In Pillow-based services, check whether EPS support needs to be reachable at all. - Check file content, not names, and reject anything whose magic bytes don't match the expected image type before it reaches a decoder.
- Isolate rendering. Run thumbnail and preview workers as an unprivileged user in a container or sandbox with no outbound network access and no access to application secrets. Then a sandbox escape lands somewhere useless.
- Update the applications too: WordPress 7.0.4 (backported to every branch from 4.7) and Roundcube's October image-type hardening (CVE-2026-114727) close their own routes on top of the Ghostscript fix.
- Re-score library bugs in context. When a "Local" CVE affects a component that processes untrusted input on a server, use CVSS environmental metrics or your own triage to raise it. The base vector describes the library, not your deployment.
