Upload2Shell: Ghostscript Sandbox Escape to RCE

Executive Summary

Ghostscript versions prior to 10.08.0 are vulnerable to a critical sandbox escape and remote code execution (RCE) vulnerability tracked as CVE-2026-125396. The flaw, discovered by pwn.ai and nicknamed 'Upload2Shell', resides in the interpreter's Type 1 font loader. By providing a crafted PostScript, EPS, or PDF document, an attacker can trigger a use-after-free condition that allows them to overwrite native memory and disable security checks, effectively turning off the -dSAFER sandbox.

This vulnerability is particularly dangerous because Ghostscript is often invoked indirectly by common image and document processing libraries such as ImageMagick, Pillow, and libvips. Attackers can reach vulnerable systems through routine features like file uploads, email attachment previews, and print jobs. Proof-of-concept exploits have successfully targeted Debian CUPS servers, WordPress media pipelines, and Roundcube webmail instances. Organizations should prioritize updating Ghostscript installations across all hosts and container images to version 10.08.0 or applying distribution-specific backported fixes.

Key Details

Threat Name

CVE-2026-125396

Affects

Ghostscript, Ghostscript before 10.08.0, Debian CUPS, Roundcube, WordPress Core, MediaWiki, Debian 13 CUPS

Adversary

—

MITRE Techniques

Malware/Tools

None identified

Report Score

8out of 10
Quality Score
Good
IOC Quality5
TTP Details9
Detection Guidance6
Enterprise Relevance9
Clarity & Structure10
Technical Depth10

Sources