[ctx]ctxseccontext security: attacks on the harness and context layer of AI agents, plus exploited-now news, hunting and playbooks.

← Playbooks

Upload2Shell (CVE-2026-125396): find every place untrusted files reach Ghostscript, patch it, and cut the path in 72 hours

For teams running webmail, CMSs, document previews, print servers or any service that converts user files. The vulnerable code is Ghostscript, but the exposure is every app that hands it a file.

For: Security, IT / ops, Developers

1. Inventory2. Patch3. Cut the path4. Hunt5. Close out
  1. Step 1 of 5

    Inventory

    Find Ghostscript, including where you didn't install it.

    • Query package managers and container images for ghostscript/libgs versions
    • List apps that use ImageMagick/Imagick, GraphicsMagick or Pillow EPS to thumbnail or convert uploads
    • List CUPS servers and whether shared queues accept unauthenticated jobs
  2. Step 2 of 5

    Patch

    Internet-facing pipelines first.

    • Upgrade to Ghostscript 10.08.0 or the distro build that includes the .putgstringcopy fix
    • Rebuild and redeploy images; bundled copies don't update with the host
    • Update WordPress to 7.0.4 or later and webmail to current releases
  3. Step 3 of 5

    Cut the path

    Don't rely on -dSAFER alone.

    • Deny PS/EPS/PDF/XPS coders in ImageMagick policy where only images are needed
    • Run converters in a sandbox with no shell, no network and a read-only filesystem
    • Require authentication on shared print queues
  4. Step 4 of 5

    Hunt

    Look back to September.

    • Search for shells or unexpected children of gs/gstopdf under web or lp accounts
    • Flag uploads and attachments named as images or PDFs that start with %!PS
    • Review outbound connections from conversion hosts
  5. Step 5 of 5

    Close out

    Keep it from coming back.

    • Add Ghostscript to the SBOM and vulnerability-scanning scope of every image
    • Track the other Ghostscript bugs pwn.ai says are still being fixed
    • Record which apps can reach Ghostscript so the next CVE takes minutes to scope

Original content by ctxsec. Printable checklist: use your browser's print view.