Loading SecureCyberVM…
SecureCyberVM
CVE Lookup Daily Threat Briefing Exploited CVEs Ransomware Zero-day
SecureCyberVM
Get the Patch Brief

Ghostscript Upload2Shell flaw CVE-2026-125396 lets crafted uploads escape sandbox

A use-after-free in Ghostscript's font loader, CVE-2026-125396, lets a crafted document escape the -dSAFER sandbox. Researchers reached it through uploads, webmail and print queues; Ghostscript 10.08.0 fixes it, but some distributions still lag.

Ghostscript Upload2Shell flaw CVE-2026-125396 lets crafted uploads escape sandbox

Ghostscript, the PostScript and PDF interpreter that many Linux servers rely on to render uploaded documents and images, contains a now-patched flaw that lets a crafted file break out of its -dSAFER sandbox and run commands on the server that processes it. The issue is tracked as CVE-2026-125396 and has been nicknamed Upload2Shell by the researchers who disclosed it.

Artifex fixed the bug in Ghostscript 10.08.0 on September 8, but the CVE was only published last week, and research from security firm pwn.ai shows how ordinary upload, preview, email and print features in common software can carry a malicious file to the vulnerable code. According to The Hacker News and Ostorlab, no exploitation in the wild has been reported.

What happened

According to The Hacker News, the root cause is a use-after-free in the part of Ghostscript that loads Type 1 fonts. A crafted document can abuse it to switch off the checks that -dSAFER is meant to enforce, which normally stop a document from running commands or touching files. Ostorlab’s technical write-up places the weakness in a PostScript helper inside the font loader that writes into protected font dictionaries without first validating its operands.

pwn.ai researcher Paulos Yibelo published the research this week. The firm fed crafted documents through about ten applications and observed a command run on the server each time, executing as the low-privilege account that performs the rendering, according to The Hacker News. Artifex developer Ken Sharp, who handled the fix, described the affected step in the bug report as “an ancient piece of code well known to be a vulnerability.”

Applications often do not call Ghostscript directly. Libraries such as ImageMagick, Pillow, libvips, CUPS and Qt plugins hand PostScript or EPS content to the interpreter when generating thumbnails, previews or conversions, and this can happen even when a file carries a .png, .jpg or .pdf extension.

Who is affected

Ostorlab states that every Ghostscript release before 10.08.0 is affected unless the distribution package carries a backported fix. Exposure depends on whether untrusted documents can reach a vulnerable build. pwn.ai reported several paths that required no login, including:

  • an anonymous print job sent to a shared CUPS queue on Debian 13;
  • an email attachment processed by Roundcube webmail when the recipient opened the message;
  • public upload forms in the WordPress plugins Forminator and Essential Addons for Elementor.

WordPress core required an account able to upload files, which Authors and higher roles have by default. WordPress closed its own route to the renderer in version 7.0.4 on August 12 under a separate identifier, CVE-2026-65640, with backports to older branches. That fix and the Ghostscript fix address different points in the chain, so one does not replace the other.

Distribution coverage is uneven. According to The Hacker News, pwn.ai’s survey from last week found Amazon Linux 2, 2023 and the 2027 Preview with a fix pending, parts of SUSE Linux Enterprise with fixes in progress, and Debian 12 listed as vulnerable. RuntimeWire reported that Amazon’s tracker still showed every Amazon Linux release as “Pending Fix” on November 21. The status of current Red Hat, Rocky Linux, AlmaLinux, Oracle Linux and stable Fedora packages was not established by the researchers.

Severity and exploitation

The CVE record rates the flaw High, with a CVSS v4.0 score of 8.5, according to Ostorlab. Although it is classified as a local vulnerability, pwn.ai reached Ghostscript over the network through print jobs, email and web uploads. Ostorlab reports that the flaw was not in CISA’s Known Exploited Vulnerabilities catalog as of November 21. A published proof-of-concept demonstrates only the underlying memory manipulation and fails on the patched build, according to The Hacker News, though third-party proof-of-concept repositories have also appeared.

What defenders should do now

  1. Upgrade Ghostscript to 10.08.0 or install the fixed package from your distribution, checking the vendor advisory rather than the upstream version number alone.
  2. Inventory every copy of Ghostscript in use, including those bundled in container images, document workers and application directories; rebuild and redeploy containers, since a patched host does not update them.
  3. Identify which libraries delegate to Ghostscript, for example with magick -list delegate, and where rendering is not needed, disable the ImageMagick Ghostscript delegate through its policy file.
  4. Update WordPress to 7.0.4 or the patched branch release, and review plugins that accept anonymous uploads.
  5. Require authentication on shared CUPS print queues and reject PostScript, EPS and PDF uploads that do not need rendering.
  6. Run renderers under an unprivileged account with AppArmor or seccomp confinement; in one pwn.ai test an AppArmor profile prevented the interpreter from starting a shell.
  7. Track distribution trackers for Amazon Linux, SUSE and Debian until fixed packages ship, and apply compensating controls in the meantime.

SCVM analysis

Upload2Shell is a reminder that the riskiest dependency is often the one an application never calls by name. Ghostscript sits several layers beneath image and document libraries, so many teams will not find it in their own dependency manifests, and the gap of more than ten weeks between the upstream fix and the CVE publication means some distributions are still catching up. Organizations that process user-supplied files should treat document rendering as an untrusted workload: isolate it, confine it and patch the renderer copies that actually run, not just the host package. The absence of reported exploitation is not a reason to wait, given that the research describes the full attack chain and multiple unauthenticated entry points.

Sources

About this article: produced by the SCVM Newsroom with AI assistance from the public sources linked above, enriched with NVD, FIRST EPSS and CISA KEV data, and checked by automated quality controls under our editorial policy. Spotted an error? Request a correction.

SecureCyberVM

Install SecureCyberVM

Get the Daily Threat Briefing and exploited-CVE alerts one tap away, full screen, like an app.