Upload2Shell: Ghostscript Type 1 font UAF escapes -dSAFER to run code in document pipelines (CVE-2026-125396)
Severity: high · Patch status: partial · Since 2026-09-07 · CVE-2026-114727, CVE-2026-125396, CVE-2026-65640
CVE-2026-125396 is a use-after-free in Ghostscript's Type 1 font loader. The helper .putgstringcopy in gsfonts.ps calls the privileged .forceput operator without checking operand types, so a crafted PostScript or PDF file can make an error handler recover .forceput and leave a dangling reference across save/restore. The researchers (Paulos Yibelo, pwn.ai) turned that into a write to native memory and then into command execution as the rendering process, with -dSAFER still on. Ghostscript is reached indirectly through ImageMagick, Pillow, CUPS and many upload, preview and print features. The researchers report command execution through Debian 13 CUPS, Roundcube thumbnails, several WordPress plugin upload paths and other applications; these chains are researcher-run and depend on the application's configuration, and no independent party has reproduced them in the sources reviewed. Artifex fixed the root in Ghostscript 10.08.0; Debian 13, Debian 12 LTS and Ubuntu (USN-8949-1) have shipped fixed packages, while the writeup (as of 12 November) listed Amazon Linux, several SUSE branches and openSUSE Leap 16 as pending or affected. No in-the-wild exploitation is reported and the CVE is not in CISA KEV. A public proof of concept exists but shows only the native memory write, not the command-execution chain. Patch Ghostscript and every bundled copy (containers, application bundles), and until then keep untrusted files away from Ghostscript or ImageMagick delegates.
What to do
- Patch Ghostscript to 10.08.0 or later, or to a distribution build that carries the fix (Debian trixie 10.05.1~dfsg-1+deb13u3 or later, Debian bookworm 10.0.0~dfsg-11+deb12u9, Ubuntu USN-8949-1 builds); also apply the Roundcube CVE-2026-114727 and WordPress CVE-2026-65640 fixes.
- Rebuild or update container images and application bundles that ship their own Ghostscript; a host package update does not reach them.
- Disable or tightly sandbox Ghostscript/ImageMagick delegates for untrusted uploads, email attachments, print jobs, and previews until all downstream paths are fixed.
- Inventory applications that invoke Ghostscript indirectly (CUPS, webmail, CMS, DAM, document preview, image thumbnailing, Pillow/Imagick/libvips callers) and test with crafted Type 1 fonts.
- Run rendering workers with least privilege and isolate network/file access; require authentication on shared print queues; monitor for unexpected child processes from Ghostscript/ImageMagick.
- Restrict anonymous upload, print, and registration features that expose renderers.
Fixed versions
- Ghostscript 10.08.0 (upstream, ghostpdl commit 1484854)
- Debian trixie 10.05.1~dfsg-1+deb13u3 (tracker; DSA-6516-1 lists deb13u2 in Debian Bugs)
- Debian bookworm 10.0.0~dfsg-11+deb12u9 (DLA-4914-1)
- Debian forky/sid 10.08.0~dfsg-2
- Ubuntu USN-8949-1: 26.10 10.07.1~dfsg-1ubuntu2.1; 26.04 10.06.0~dfsg-3ubuntu1.2; 24.04 10.02.1~dfsg1-0ubuntu7.10; 22.04 9.55.0~dfsg1-0ubuntu5.15; 20.04, 18.04 and 16.04 ESM builds
- WordPress 7.0.4 (CVE-2026-65640)
- Roundcube 1.7.5 and 1.6.20 (CVE-2026-114727)
Sources
All live incidents on Threat Watch