Upload2Shell – A critical RCE vulnerability affecting Ghostscript
24 Nov 2026
Security researchers have discovered a critical security vulnerability in Ghostscript named Upload2Shell, tracked as CVE-2026-125396, that attackers can exploit to execute arbitrary commands on systems processing specially crafted documents.
Let’s break down what Upload2Shell is, the threat it poses, and what organizations should do.
About Upload2Shell
|
Name |
CVE / Severity
|
Affected vendor + component |
Type |
Affected version |
Fixed version |
|
Upload2Shell |
CVE-2026-125396 / 8.5(High) |
Artifix Software + Ghostscript |
Use-After-Free/Sandbox Escape |
Ghostscript versions earlier than 10.08.0 |
Ghostscript 10.08.0 |
Ghostscript is software that helps applications open, read, convert, and generate previews of PDF and PostScript files. Example: when a website generates a preview of a PDF, it is done using Ghostscript, the same way a printing service processes documents before printing.
Ghostscript has a flaw in the way it handles Type 1 fonts (a font type used in PostScript documents)
An attacker can bypass Ghostscript’s security restrictions through a specially crafted document that exploits this flaw. It could allow an attacker to execute commands on the server running Ghostscript.
Uploading a file does not always trigger an attack, though. It must be processed by the application using the vulnerable Ghostscript installation through the following workflow:
- Generate a document preview.
- Convert a PDF/PostScript file.
- Generate an email attachment document.
- Process a document for printing.
What an attacker can do with Upload2Shell?
By successfully exploiting the flaw, an attacker can:
- Execute arbitrary commands with the privileges of the process rendering the crafted document.
- Cause a compromise of a vulnerable web application or document-processing service.
- Access files, application data, or configuration information available to the compromised process.
- Affect the hosting environment in WordPress and the website’s integrity and availability.
- Use malicious documents to cause abnormal application behavior, processing failures, or service crashes.
- Use a compromised rendering process as an entry point for additional activity, depending on its permissions and network access.
SharkStriker’s recommendations
- Identify Ghostscript Installations: Inventory Ghostscript across web servers, WordPress hosting environments, Linux systems, containers, and document-processing services. Include copies bundled within applications or rendering workers.
- Prioritize Internet-Facing Services: Review WordPress websites, public file-upload forms, webmail platforms, document-management systems, and shared print services that process untrusted files.
- Update Ghostscript: Upgrade affected installations to version 10.08.0 or a vendor-provided patched build. Confirm the security status of distribution packages rather than relying solely on the displayed upstream version.
- Update WordPress: Upgrade WordPress to version 7.0.4 or the applicable patched release for the installed branch. Also review plugins that provide public file-upload functionality.
- Review Image Processing Configurations: Verify whether ImageMagick, Imagick, or other image-processing libraries invoke Ghostscript when handling uploaded files. Restrict unnecessary PostScript and document-processing capabilities where operationally feasible.
- Restrict Untrusted File Processing: Review public upload forms and ensure that files submitted by unauthenticated users are not automatically passed to vulnerable document-rendering workflows.
- Isolate Rendering Processes: Run document and image-processing workers with minimal privileges, restricted filesystem access, and limited network connectivity. Avoid granting rendering services unnecessary access to application secrets or sensitive directories.
- Secure Print Services: Review CUPS configurations and ensure shared print queues are not exposed to unauthenticated users unless explicitly required.
- Monitor Suspicious Process Activity: Configure monitoring for unexpected shell execution, file modifications, and outbound connections originating from web application and document-rendering processes.
- Validate Remediation: Verify the actual Ghostscript build used by each application after patching. Restart affected services and rebuild container images where necessary to ensure that patched components are loaded.