---
title: Tip: patch Ghostscript, then stop image pipelines from handing files to it at all: disable PS, EPS, PDF and XPS coders in ImageMagick's policy.xml where you only process images | ctxsec
url: https://ctxsec.com/items/tip-ghostscript-upgrade-and-block-postscript-pdf-eps-xps-coders-in-imagemagick-policy-where-you-only-need-images
description: "Upload2Shell works because a file with a trusted extension gets routed to Ghostscript by content. If an app only needs images, Ghostscript shouldn't be reachable from it."
status: "guide (prompted by CVE-2026-125396; fix per Artifex and Debian)"
published: 2026-11-21
---

> Upload2Shell works because a file with a trusted extension gets routed to Ghostscript by content. If an app only needs images, Ghostscript shouldn't be reachable from it.

[← Tips & Guides](/tips) · [markdown](/items/tip-ghostscript-upgrade-and-block-postscript-pdf-eps-xps-coders-in-imagemagick-policy-where-you-only-need-images.md)

guide (prompted by CVE-2026-125396; fix per Artifex and Debian)

2026-11-21 7:40 PM ET

### Tip: patch Ghostscript, then stop image pipelines from handing files to it at all: disable PS, EPS, PDF and XPS coders in ImageMagick's policy.xml where you only process images

- Upgrade to Ghostscript 10.08.0 or your distro's fixed build, including inside containers.
- In ImageMagick's policy.xml, deny the PS, PS2, PS3, EPS, PDF and XPS coders for apps that only thumbnail images; run conversions in a sandbox with no shell and no network.
- Require authentication on shared CUPS queues.

Sources: [pwn.ai (Paulos Yibelo): How We Hacked the Pipes, Upload2Shell, CVE-2026-125396 (dated Nov 17, 2026)](https://pwn.ai/upload2shell/research.html) · [Debian security tracker: CVE-2026-125396 (DSA-6516-1, DLA-4914-1)](https://security-tracker.debian.org/tracker/CVE-2026-125396)
