Ghostscript Type 1 font bug enables RCE past -dSAFER (CVE-2026-125396)
Original title: GhostScript CVE 2026-125396: "Upload2Shell"
Researchers say ordinary image uploads can reach Ghostscript and turn a font-loader bug into command execution.
Researchers describe Upload2Shell, CVE-2026-125396, a use-after-free in Ghostscript’s Type 1 font loader that yields a write-what-where primitive. A crafted document can change the state enforcing -dSAFER and run commands as the rendering process. They say most tested applications with file uploads passed trusted-looking files to Ghostscript through libraries such as ImageMagick, Pillow, Imagick and libvips. They reported bugs to Artifex and say some are still being fixed.
Unconfirmed: Fixed Ghostscript versions are not stated, and some reported bugs are still being fixed.
- The bug is a use-after-free in the Type 1 font loader.
- A WordPress-shaped Imagick preview reached Ghostscript under -dSAFER.
- EPS bytes named .png still invoked Ghostscript in decoder tests.
- Tests ran on Ubuntu 24.04 across 29 image APIs in one matrix.
- Individual application findings are being published as a series.
Impact: Remote command execution as the rendering process
| Product | Affected |
|---|---|
| Artifex Ghostscript | — |
- 1.Review image upload and preview paths that delegate rendering to Ghostscript.
- 2.Track Artifex fixes; the researchers say some reported bugs are still being fixed.
- CVEs
- CVE-2026-125396
- Vendors
- Artifex
Vulnerabilities mentioned
All| CVE | Vulnerability | CVSS | EPSS | Signals | Published |
|---|---|---|---|---|---|
| CVE-2026-125396 | -dSAFER bypass and code execution in Ghostscript before 10.08.0 | 8.5 | <1% | PoC ×2 |
From the original article
13 min read at pwn.ai
Here's the NVD page for the CVE with some additional useful context. Comments
By pwn.ai via hoistbypetard · pwn.ai
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.