VYPR
patchPublished Nov 22, 2026· 1 source

Ghostscript Upload2Shell Flaw Lets Attackers Execute Commands on WordPress, Email, and Print Servers

A critical vulnerability in Ghostscript, dubbed Upload2Shell (CVE-2026-125396), allows attackers to execute commands on various servers by exploiting its Type 1 font loader, bypassing security measures.

A critical vulnerability, identified as Upload2Shell and tracked by CVE-2026-125396, has been discovered in the widely used Ghostscript software, affecting versions prior to 10.08.0. This flaw resides within the software's Type 1 font loader and enables attackers to execute arbitrary commands on affected servers. The vulnerability's impact is significant as it can be exploited through routine file processing, even when Ghostscript itself is not directly exposed to the internet. Services that rely on Ghostscript for features like file previews, thumbnail generation, or print job processing are potentially vulnerable.

The vulnerability was detailed in research published on November 17 by Paulos Yibelo and pwn.ai. They demonstrated that network-facing services could pass remotely supplied files to the vulnerable Ghostscript code. The research highlighted that the flaw undermines Ghostscript's intended security sandbox, known as -dSAFER mode, through a use-after-free memory corruption vulnerability. This memory flaw occurs when the software improperly handles references to data after releasing the memory it occupied, leading to a failure in type checking before an operation that could trigger an error. This error inadvertently exposes a protected write operation that should not be controllable by document code.

Researchers successfully leveraged this memory flaw to manipulate Ghostscript's security checks, even while -dSAFER mode was active. The commands executed in their demonstrations ran with the permissions of the Ghostscript renderer, not with elevated root privileges, but these permissions are often sufficient to cause significant damage or facilitate further compromise. The research focused on the technical demonstration of exploitation rather than confirmed instances of in-the-wild attacks.

Several common services were shown to be vulnerable. On WordPress sites utilizing Imagick and ImageMagick for media previews, attackers with media upload privileges could exploit the flaw. The WordPress core advisory tracks this specific upload vector as CVE-2026-65640, and patches have been backported to recent versions. The researchers also found that certain public upload features in plugins like Forminator and Essential Addons for Elementor could expose Ghostscript to exploitation without requiring user login.

Beyond WordPress, the vulnerability also affected Roundcube webmail and Linux print servers. In a test configuration of Roundcube 1.7.2, an attacker could exploit the flaw by sending a message with a malicious attachment; the server's automatic thumbnail generation process, which passed the file through ImageMagick to Ghostscript, triggered the vulnerability. The command execution occurred on the server as the web service account, not on the recipient's device. Similarly, on a Debian 13 system, a shared CUPS print queue accepted network print jobs, sending the malicious document to Ghostscript for conversion and leading to command execution as the print service account.

Artifex, the maintainer of Ghostscript, has addressed the underlying vulnerability in Ghostscript version 10.08.0. However, the responsibility for patching also falls on Linux distributions and individual service administrators. Older Ghostscript releases can be patched by distributions, meaning the upstream version number alone is not a definitive indicator of exposure. Administrators are urged to verify the specific Ghostscript version used by each service and check their vendor's package status for CVE-2026-125396. Updating host systems may not automatically patch Ghostscript within containerized environments or application bundles.

To mitigate the risks, organizations should prioritize updating Ghostscript to version 10.08.0 or later, or apply vendor-provided patches. For WordPress, this includes updating both the core software and ensuring the Ghostscript renderer is patched, along with reviewing public upload forms. If immediate patching is not feasible, disabling automatic previews for untrusted files can serve as a temporary workaround. On print servers, enforcing authentication for shared queues and restricting network access are recommended security measures. A broader strategy involves isolating renderers, granting their service accounts minimal necessary permissions, and meticulously tracing the worker processes responsible for generating previews, thumbnails, or print output to ensure they are utilizing patched Ghostscript packages.

Synthesized by Vypr AI