Informational
Advisory: Ghostscript Sandbox Bypass Vulnerability - Upload2Shell (CVE-2026-125396)
CVE(S)
CVE-2026-125396
PRODUCT(S)
N/A
Updated
2026 Nov 23
Article Version
1
First Published
2026 Nov 23
Publication ID
sophos-sa-20261123-upload2shell
Workaround
No
Overview
A vulnerability in Ghostscript, CVE-2026-125396 (also referred to as “Upload2Shell”), allows a crafted PostScript or PDF file to bypass Ghostscript’s -dSAFER sandbox and execute commands with the privileges of the process running Ghostscript. It affects Ghostscript versions before 10.08.0. VulnCheck rates it CVSS 4.0 8.5 (High).
On November 21, 2026, researchers published technical details showing remote code execution in several widely used applications that pass user-supplied files to Ghostscript. Any application that processes untrusted files with Ghostscript is potentially exposed, whether it calls Ghostscript directly or through software such as ImageMagick or Pillow. Common paths include file uploads, thumbnail and preview generation, document conversion and print services. Proof-of-concept exploit code is publicly available. Sophos is not aware of any public reports of this vulnerability being exploited in the wild at this time.
Are Sophos products affected?
Sophos is reviewing its products and services for this vulnerability. We will update this advisory if any Sophos product or service requires customer action.
General guidance for non-Sophos systems
The following guidance is for systems that you manage yourself, such as servers, web applications and third-party appliances. It does not apply to Sophos products.
Patching
Ghostscript 10.08.0 and later fix this vulnerability. Linux distributions are releasing updated packages and may backport the fix without changing the reported Ghostscript version, so check your distribution’s security tracker. Applications that bundle or invoke Ghostscript may need their own updates; confirm patch status with those vendors.
Identifying affected systems
- Identify systems with Ghostscript installed (gs, libgs), including where it is used through ImageMagick, Pillow or print services such as CUPS, and in container images.
- Prioritise internet-facing services that process user-supplied PDF, PostScript or EPS files, such as upload forms, webmail, document management systems and content management systems.
- Include third-party appliances and applications that process documents, and confirm patch status with those vendors.
Temporary mitigation
Until you can update, avoid passing untrusted PostScript, EPS or PDF files to Ghostscript. For example, disable the PS, EPS and PDF coders in ImageMagick’s security policy, or run document conversion in an isolated, low-privilege environment. The -dSAFER option alone does not protect against this vulnerability. Sophos has not validated these measures. Test them before deploying them, and treat them as temporary measures only. Updating Ghostscript is the only fix for the vulnerability.
Related information
- https://www.cve.org/CVERecord?id=CVE-2026-125396
- https://www.sophos.com/en-us/blog/proof-of-concept-available-for-ghostscript-upload2shell
- https://pwn.ai/upload2shell
- https://www.openwall.com/lists/oss-security/2026/11/22/1
- https://security-tracker.debian.org/tracker/CVE-2026-125396
- https://ubuntu.com/security/CVE-2026-125396
Sophos Responsible Disclosure Policy
To learn about Sophos security vulnerability disclosure policies and publications, see the Responsible Disclosure Policy.