On November 21, 2026, security researchers published technical details about Upload2Shell (CVE-2026-125396), a high-severity vulnerability in Ghostscript that may allow arbitrary code execution through malicious file processing.
Ghostscript is widely used on Linux servers for document conversion, image processing, PDF previews, thumbnail generation, and printing services.
The vulnerability was fixed upstream in Ghostscript 10.08.0, released on September 8, 2026. Linux distributions are also providing security fixes through backported packages.
Security Vulnerability
| Parameter | Description |
|---|---|
| CVE Identifier | CVE-2026-125396 |
| Vulnerability Name | Upload2Shell |
| Affected Software | Ghostscript |
| Vulnerability Type | Use-after-free, sandbox escape |
| CVSS 4.0 Score | 8.5 (High) |
| Security Impact | Arbitrary code execution |
| Fixed Upstream Version | 10.08.0 |
The vulnerability affects Ghostscript's internal font processing functionality and allows specially crafted PostScript documents to bypass the -dSAFER security sandbox.
Successful exploitation may allow attackers to execute arbitrary commands with the permissions of the process handling the document.
Affected Applications
The vulnerability may affect applications and services that rely on Ghostscript directly or through third-party libraries.
Potentially exposed software and services include:
- ImageMagick and PHP Imagick.
- Pillow and libvips.
- WordPress and file upload plugins.
- Roundcube Webmail.
- CUPS printing services.
- Web hosting control panels.
- Document management systems.
- PDF preview and thumbnail generation services.
A file does not necessarily need a PostScript extension to reach the vulnerable interpreter. Files with common extensions such as .jpg, .png, or .pdf may also trigger Ghostscript processing, depending on the application.
Security Impact
Successful exploitation may result in:
- Remote code execution (RCE) through exposed file-processing services.
- Unauthorized access to website and application data.
- Modification or deletion of accessible files.
- Compromise of hosting accounts.
- Execution of malicious commands.
- Denial of service (DoS).
Internet-facing applications that automatically process user-supplied documents and images should be treated as a priority.
Although the vulnerability is classified with a local attack vector, remote exploitation is possible through applications that pass untrusted files to Ghostscript.
Update Recommendations
We strongly recommend that customers running Ghostscript on their virtual or dedicated servers install the available security updates.
Check your currently installed Ghostscript version:
gs --version
Updating Ghostscript
Use the following commands to update Ghostscript through your Linux distribution's package manager.
apt update
apt install --only-upgrade ghostscript
gs --version
dnf upgrade 'ghostscript*' libgs
rpm -q ghostscript libgs
The availability of security updates depends on your Linux distribution and configured package repositories. Distribution-maintained packages may contain backported security fixes without changing the upstream version number.
After completing the update, restart any affected services that have the Ghostscript library loaded into memory.
Containerized applications and applications with bundled Ghostscript installations must be updated separately.
Temporary Mitigation
If an immediate update is not possible, consider the following measures:
- Restrict untrusted document and image uploads.
- Disable unnecessary PDF and document preview generation.
- Disable unused PostScript, EPS, and PDF coders in ImageMagick.
- Restrict access to shared printing services.
- Run document conversion processes in isolated, low-privilege environments.
These measures may reduce exposure but do not eliminate the vulnerability. The Ghostscript -dSAFER option alone does not provide protection against Upload2Shell.
Installing the available security updates remains the recommended solution.
Regularly installing security updates is essential for maintaining a secure, reliable, and stable hosting environment.