November 22, 2026 / news

Ghostscript Upload2Shell (CVE-2026-125396): Font-Loader Use-After-Free Breaks the dSAFER Sandbox

Ghostscript 10.08.0 fixed CVE-2026-125396, a use-after-free in the Type 1 font loader that lets a crafted file disable the -dSAFER sandbox and run commands; pwn.ai demonstrated remote paths via CUPS, Roundcube and WordPress uploads.

Title: Ghostscript Upload2Shell (CVE-2026-125396): Crafted Files Escape the dSAFER Sandbox and Run Commands on Servers

Summary: Security firm pwn.ai has published Upload2Shell, a detailed write-up of CVE-2026-125396, a use-after-free in Ghostscript’s Type 1 font loader. The faulty code is the .putgstringcopy helper in Resource/Init/gs_fonts.ps: it invokes the privileged .forceput operator on whatever operands it is given, without validating their types. A crafted PostScript file (delivered inside a name ending in .png, .jpg or .pdf) can trip that type error, install an attacker-defined error handler to reclaim .forceput, and obtain a write-what-where primitive across save/restore that lets it turn off Ghostscript’s native path-control state — the enforcement behind -dSAFER — and then execute a command as the rendering process. The flaw affects ghostpdl before 10.08.0 and is scored 8.5 under CVSS 4.0 with a local attack vector, but pwn.ai demonstrated repeatable remote chains: an anonymous IPP print job to a shared Debian 13 CUPS queue (command as uid=7(lp)), an emailed attachment that Roundcube 1.7.2 thumbnail-processed on view (as www-data), and unauthenticated upload paths in the WordPress plugins Forminator and Essential Addons for Elementor; WordPress Core’s own path (Author+ upload on Imagick/Ghostscript sites) was fixed separately as CVE-2026-65640 in 7.0.4 on August 12 — the two fixes cover different points in the same chain. Artifex shipped the root fix in Ghostscript 10.08.0 on September 8, 2026; no exploitation in the wild has been reported. Distribution coverage is uneven: as of mid-November pwn.ai’s survey still lists Debian 12 (Bookworm) as vulnerable, Amazon Linux 2/2023/2027 Preview with fixes pending, several SUSE branches in progress, and openSUSE Leap 16.0/16.1 affected, while Ubuntu fixed seven releases in USN-8949-1 on October 21 and Debian 13 (Trixie) carries the patched package. Updating the host OS does not update Ghostscript copies bundled inside containers or applications, so operators should confirm the renderer actually in use is 10.08.0 or a backport, require authentication on shared print queues, and restrict accepted upload types.

References:

← All news