---
title: Hunt: Upload2Shell (CVE-2026-125396): alert on gs processes spawning shells under web-server or print accounts, and on uploads whose bytes are PostScript but whose names say image or PDF | ctxsec
url: https://ctxsec.com/items/hunt-ghostscript-upload2shell-shells-spawned-by-gs-under-web-or-lp-accounts-postscript-disguised-as-jpg-png-pdf
description: "In pwn.ai's proofs the payload arrived as an ordinary-looking file (quarterly-results.jpg, a .pdf) whose contents were PostScript, was handed by Imagick/ImageMagick or CUPS to Ghostscript under -dSAFER, and ran a command through Ghostscript's %pipe% device as the rendering account (www-data for Roundcube, lp for CUPS). That gives two places to look."
status: "research (based on pwn.ai's Upload2Shell write-up, Nov 2026)"
published: 2026-11-21
---

> In pwn.ai's proofs the payload arrived as an ordinary-looking file (quarterly-results.jpg, a .pdf) whose contents were PostScript, was handed by Imagick/ImageMagick or CUPS to Ghostscript under -dSAFER, and ran a command through Ghostscript's %pipe% device as the rendering account (www-data for Roundcube, lp for CUPS). That gives two places to look.

[← Threat Hunting](/hunting) · [markdown](/items/hunt-ghostscript-upload2shell-shells-spawned-by-gs-under-web-or-lp-accounts-postscript-disguised-as-jpg-png-pdf.md)

research (based on pwn.ai's Upload2Shell write-up, Nov 2026)

2026-11-21 7:40 PM ET

### Hunt: Upload2Shell (CVE-2026-125396): alert on gs processes spawning shells under web-server or print accounts, and on uploads whose bytes are PostScript but whose names say image or PDF

- **Process:** gs, ghostscript or gstopdf with a child shell (sh, bash, dash) or other unexpected child, especially under www-data, apache, nginx, php-fpm or lp.
- **Content:** uploads and mail attachments named .jpg/.png/.pdf whose first bytes are `%!PS` or a Type 1 font header; ImageMagick policy denials in logs.
- **CUPS:** print jobs from unexpected or anonymous IPP clients to shared 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)
