Ghostscript: steps to check whether your server is exposed

Ghostscript: steps to check whether your server is exposed

Ghostscript versions earlier than 10.08.0 contain a vulnerability that allows a crafted document to bypass the -dSAFER sandbox and execute commands with the permissions of the process handling it. CVE-2026-125396 can be reached through uploads, previews, email, or printing: pwn.ai demonstrated paths in several applications, some without authentication, although The Hacker News reports no known exploitation in attacks.

The issue affects servers and services that process files with Ghostscript, even if the application does not invoke it directly. Libraries such as ImageMagick, Pillow, libvips, or Qt plugins can pass PostScript or EPS content to the interpreter during conversion or thumbnail generation; the file extension alone is not enough to rule out this path, because pwn.ai tested PostScript content with names such as .png.

Demonstrated cases include a shared Debian 13 queue accessible through an anonymous print job, Roundcube when opening an attachment, and public forms in Forminator and Essential Addons for Elementor. In WordPress Core, upload access was available to users with the Author role or higher, according to The Hacker News. Execution occurred under the low-privilege account used by the renderer, not necessarily with administrator permissions.

1. Locate all file-processing entry points

  1. Inventory file workflows that lead to conversion, preview, cropping, or thumbnail generation. Include web forms, incoming email, print queues, and document workers. Pwn.ai found Ghostscript in paths triggered by common image-reading operations: a file can reach the interpreter when the application tries to decode pixels, not when it saves the file.

  2. Check dependencies that lead to Ghostscript. The Hacker News cites ImageMagick, Pillow, libvips, and Qt plugins; in specific configurations, pwn.ai observed Pillow calls such as load(), crop(), or thumbnail(), as well as paths involving Imagick and QImageReader. The fact that the code does not invoke «gs» does not prove that the process does not use Ghostscript: it may be integrated as a library or called by another dependency.

  3. Also inspect container images and copies bundled with an application. Updating Ghostscript on the host system does not change a standalone version included in a container or in the product itself. Identify which binary or library each processing worker actually uses.

2. Update the component that performs the rendering

  1. Target Ghostscript 10.08.0, the version in which Artifex fixed CVE-2026-125396, or install the security update for your distribution. Do not assume the upstream version number appears the same in the package: Debian, for example, lists 10.05.1~dfsg-1+deb13u3 as the available version for trixie. The number alone does not replace checking the package status and whether the fix is included.

  2. On Debian, consult the Ghostscript security record for your distribution version; the Debian Security Tracker marks CVE-2026-125396 as resolved. On Ubuntu, the CVE page referenced here still lists several versions as «Needs evaluation», while pwn.ai notes that Ubuntu released fixed packages for seven supported versions on October 21, 2026. Verify the advisory that applies to your version and the package's current status before considering the update complete.

  3. Repeat the update wherever processing runs: hosts, containers, deployment images, and copies bundled with the application. Then check that the document or image worker is using the updated package. The host version alone does not prove that the active renderer has changed.

3. Close entry points while you deploy

  1. Require authentication for shared print queues until you have updated the renderer. The Hacker News recommends this exposure-reduction measure following the test involving a Debian 13 queue accessible without logging in.

  2. Limit the file types accepted by each processor, especially in public forms and features that pass attachments to ImageMagick or another image library. Check whether a workflow accepts formats that are later interpreted as PostScript or EPS; a filename ending in .jpg or .png does not guarantee that the bytes are in that format.

  3. Apply application patches separately. WordPress released the fix for its upload path in 7.0.4, under CVE-2026-65640, before the Ghostscript fix; updating one does not eliminate the need to update the other. Roundcube also restricted unsafe attachment types before image conversion in a separate fix, CVE-2026-114727.

4. Check defenses and scope

  1. If you use AppArmor, check that the rendering process profile limits what it can launch. In one of the tests described by The Hacker News, an AppArmor profile prevented the compromised interpreter from launching a shell. Do not treat this as a substitute for the patch: the fix is still to update Ghostscript.

  2. Determine the permissions of the account running the renderer and which services share that process. In the demonstrated cases, commands ran under the renderer's low-privilege account. This helps define the potential impact of each affected path and prioritize workers exposed to unauthenticated uploads.

  3. Review the inventory again after updating. Include indirect processes, such as email importers and thumbnail generators, not just services whose code mentions Ghostscript. pwn.ai also traced libraries linked within the process, so searching exclusively for explicit Ghostscript commands may leave paths out of the analysis.

Mistakes that leave exposure unchanged

Updating only the host system can leave an old Ghostscript version in a container or application. Check every copy that processes documents; the fix must reach the active component, not merely a parallel installation.

Do not confuse the WordPress fix with the Ghostscript fix, or an application update with an interpreter update. They are separate points in the chain: WordPress fixed its own upload path, and Artifex fixed the interpreter vulnerability.

Finally, do not rule out a file based on its extension or assume a workflow is safe because it requires an apparently harmless operation, such as creating a preview. The crucial step is knowing which decoder processes the bytes and which version of Ghostscript ends up running.

Sources: The Hacker News, pwn.ai, pwn.ai, Ubuntu, Debian Security Tracker