
A file upload feature is generally considered a routine application function. Users upload images, attach documents, generate previews and download converted files. Behind these seemingly harmless operations, however, multiple libraries and interpreters work together to process the submitted content.
Upload2Shell exposes what can happen when one of those underlying components becomes the attacker’s entry point.
Discovered by security researcher Paulos Yibelo and the pwn.ai research team, Upload2Shell is a vulnerability in Ghostscript that allows specially crafted PostScript or PDF documents to bypass its security restrictions and execute attacker-controlled commands through applications that rely on its document-processing capabilities.
The vulnerability is tracked as CVE-2026-125396 and affects Ghostscript versions earlier than 10.08.0. pwn.ai research +2
How the vulnerability works
Ghostscript is widely used to interpret PostScript and PDF documents. It also operates behind several applications that handle document conversion, image processing, printing and thumbnail generation.
The vulnerability originates in Ghostscript’s Type 1 font loader, specifically the .putgstringcopy procedure in gs_fonts.ps.
An unsafe use of the privileged .forceput operator, combined with a crafted error-handling sequence, allows an attacker to trigger a use-after-free condition. This can provide memory manipulation capabilities that ultimately allow the attacker to bypass Ghostscript’s -dSAFER sandbox restrictions.
Once those restrictions are bypassed, attacker-controlled commands can be executed with the privileges of the Ghostscript rendering process.
The important distinction is that the attack does not necessarily require an application to expose Ghostscript directly. An application may simply pass an uploaded document to an image-processing library, which subsequently invokes Ghostscript behind the scenes. pwn.ai +1
Where the attack surface expands
The pwn.ai research is particularly interesting because it demonstrates how the same underlying vulnerability can be reached through different application workflows.
WordPress: Media uploads and image-processing workflows can invoke Ghostscript through ImageMagick or Imagick. The researchers also identified vulnerable paths involving third-party upload functionality.
Roundcube: Email attachment processing can trigger the vulnerable rendering path when the server generates image previews or thumbnails. The research demonstrated command execution when a recipient viewed a specially crafted email.
CUPS: Document conversion during print processing can expose the same vulnerability. The researchers demonstrated an attack through an unauthenticated network print queue.
These examples highlight a common weakness: the application accepting the file and the component interpreting the file are two different security boundaries. pwn.ai research +2
Why this deserves attention
Upload2Shell is a reminder that file validation alone is not sufficient.
An application may validate the extension, MIME type and upload size, but those checks do not guarantee that the underlying file content matches the declared format.
A file named image.png can contain PostScript content. If the processing pipeline identifies and passes that content to Ghostscript, the vulnerable interpreter becomes the actual attack surface.
This makes document-processing dependencies particularly important in environments hosting customer portals, webmail platforms, content-management systems and shared printing infrastructure.
The vulnerability has a CVSS 4.0 score of 8.5. The CVSS 3.1 score is 7.8, reflecting a different scoring methodology. explore.alas.aws.amazon.com +1
Remediation and security recommendations
Artifex addressed the vulnerability in Ghostscript 10.08.0, released on September 8, 2026.
Security teams should prioritise the following actions:
- Identify all Ghostscript installations across servers, containers and application environments.
- Upgrade to Ghostscript 10.08.0 or the corresponding security-patched distribution package.
- Review ImageMagick and Imagick configurations, particularly Ghostscript delegates.
- Assess WordPress, Roundcube and CUPS deployments for exposure.
- Restrict unauthenticated access to network printing services.
- Run document-processing services with least-privilege accounts.
- Monitor unexpected process creation and command execution by document-rendering services.
- Review application logs for suspicious document-processing activity.
One important consideration: Linux distributions may backport security fixes without changing the upstream Ghostscript version to 10.08.0. Therefore, verify the distribution’s security advisory and installed package revision rather than relying exclusively on the version string.
Where immediate patching is unavailable, restricting Ghostscript processing through ImageMagick policy controls can provide a temporary mitigation. However, this may disrupt PDF and image-preview functionality and does not replace the underlying Ghostscript security update. Upload2Shell – cPanel +2
The real attack surface is not just what an application accepts. It is everything that processes what the application accepts.


