Researchers at pwn.ai have disclosed Upload2Shell, tracked as CVE-2026-125396, a use-after-free in Ghostscript’s Type 1 font loader.
A crafted PostScript or PDF document can escape the -dSAFER sandbox and run operating system commands as the rendering process.
The flaw carries a CVSS 4.0 score of 8.5 and affects every Ghostscript release before 10.08.0. Researcher Paulos Yibelo found it with AI assistance, and a working PostScript proof-of-concept is now public.
The root cause sits in how the interpreter handles font procedures. PostScript is a programming language, so rendering a file means executing it, and -dSAFER depends on interpreter-level checks to restrict file access and command execution.
The payload frees a font object while a bound procedure still references it. It then reclaims that memory with attacker-controlled data and corrupts interpreter state, which invalidates those checks.
Parser memory corruption of this kind recurs across the industry, as in the critical RCE defects patched in the Adobe DNG SDK.
Exposure does not require a direct Ghostscript call. An attacker uploads a PostScript file disguised with a .jpg, .png or .pdf extension.
The application passes it to ImageMagick, and the Imagick delegate hands it to Ghostscript for thumbnail generation. On WordPress, the injected command ran as uid=33, the web server account.
pwn.ai confirmed unauthenticated execution through the Essential Addons for Elementor registration widget and through Forminator PDF forms that write to the Media Library. Upload-driven RCE in WordPress plugins is a familiar pattern, as the Tutor LMS flaw affecting 100K sites showed.
The attack surface extends well past content management systems. In Roundcube, an external sender’s attachment is thumbnailed when the recipient opens the message, so no click or download is needed.
The same path was confirmed in Plesk Obsidian. MediaWiki’s PdfHandler is reachable as well. On Debian 13, an IPP job sent to a shared CUPS queue executed commands as the lp user without authentication. The CVSS vector reads local, but these delivery chains make the exploit remotely reachable.
Artifex fixed the defect in Ghostscript 10.08.0 on September 8, 2026, but several Linux distributions still ship vulnerable packages.
A separate Ghostscript JPEG 2000 memory corruption flaw followed a similar dependency chain, and WordPress 7.0.4 addressed that one only.
The Ghostscript fix for Upload2Shell must be applied separately. AI-assisted discovery is also shrinking the gap between patch release and public exploit code, as Microsoft’s AI finding 59 Linux kernel flaws, including 8 exploitable root bugs illustrates.
Administrators should upgrade to 10.08.0 or a distribution backport and confirm the result with gs –version. They should also disable the PS, EPS, PDF, XPS and MSL coders in the ImageMagick policy.xml, and remove Ghostscript delegates where rendering is not required.
Renderers should run in isolated containers with seccomp filtering, a read-only filesystem and no network egress. Magic-byte validation will not stop this chain, because the payload is valid PostScript. Defenders should instead alert on gs spawning sh, curl or wget under php-fpm, www-data or lp.
Site: Thecyberdef.com
Follow TheCyberDef on Google News, LinkedIn & X for the latest cybersecurity updates. Stay informed.