Latest briefing

Proof-of-concept exploit code available for Ghostscript 'Upload2Shell' vulnerability (CVE-2026-125396)

TL;DR

Artifex Ghostscript contains a high-severity sandbox bypass vulnerability, CVE-2026-125396, dubbed 'Upload2Shell'. Attackers can execute arbitrary code by sending crafted PostScript or PDF documents. Upgrade to Ghostscript version 10.08.0 or later immediately.

What happened

A use-after-free vulnerability in Ghostscript allows attackers to bypass the -dSAFER sandbox. The flaw exists in the .putgstringcopy procedure within gs_fonts.ps, where the code calls the privileged .forceput operator without verifying operand types. By supplying a crafted document that triggers a type error, an attacker can use a custom error handler to recover .forceput and execute arbitrary code.

On November 21, 2026, pwn.ai published a proof of concept for this vulnerability. While Artifex released a patch in September, the vulnerability remains a risk for those running unpatched versions.

Why it matters

This is a high-impact flaw because it breaks the primary security boundary in Ghostscript. The -dSAFER sandbox is intended to prevent malicious documents from interacting with the underlying system, but this use-after-free vulnerability provides a direct path to code execution. For any organization that uses Ghostscript to automatically render, convert, or process incoming PostScript or PDF files, this represents a significant risk of remote compromise via a single malicious file.

Who is affected

  • Ghostscript versions before 10.08.0

What to do now

  1. Upgrade Ghostscript to version 10.08.0 or later.
  2. Prevent Ghostscript from processing untrusted or unverified files until updates are applied.
  3. Monitor your Linux, macOS, or Windows distributions for updated Ghostscript packages.

What we don't know yet

  • Whether there are reports of active exploitation in the wild.
  • The full scope of potential victims or specific impacted services.

Sources

  1. sophos.comhttps://www.sophos.com/en-us/blog/proof-of-concept-available-for-ghostscript-upload2shell
  2. github.comhttps://github.com/ArtifexSoftware/ghostpdl/commit/1484854e0c8ddfda1baa4ad4cd965b8a9790aa81
  3. github.comhttps://github.com/ArtifexSoftware/ghostpdl
  4. bugs.ghostscript.comhttps://bugs.ghostscript.com/show_bug.cgi?id=709684
  5. github.comhttps://github.com/ArtifexSoftware/ghostpdl/blob/ghostpdl-10.07.0/Resource/Init/gs_fonts.ps#L1026-L1035
  6. nvd.nist.govhttps://nvd.nist.gov/vuln/detail/cve-2026-125396

Offensive security engineer, ethical hacker and penetration tester. Writes Unpatched Intel from h4rithd.com.