AI Development
Upload2Shell in Ghostscript: a fake image runs commands on your server. How to protect your web app with Claude Code
Upload2Shell (CVE-2026-125396) is a Ghostscript flaw: a fake file uploaded as a photo runs commands on the server. Fix it with 10.08.0 and Claude Code prompts.

Luca Di Domenico
· 7 min read
In short
Upload2Shell (CVE-2026-125396) is a vulnerability in Ghostscript, the program many sites use for previews and thumbnails: a print file named photo.png makes the server run commands. GPT-5.6 Sol found it with Paulos Yibelo of pwn.ai, who published it on November 21, 2026, and it reached Google’s servers and WordPress. The fix is updating WordPress to 7.0.4 or 6.9.7, Ghostscript to 10.08.0 including inside containers, and accepting only real images: the Claude Code prompts are below.
If your web app lets users upload images, a single fake file is now enough to make your server run commands and read your users’ data. The vulnerability is called Upload2Shell (CVE-2026-125396) and it lives in Ghostscript, a program many sites use without knowing it to create previews and thumbnails. The fix exists: Ghostscript 10.08.0. Below you’ll find how to tell whether you’re at risk and the prompts to give Claude Code to fix it.
What is Upload2Shell and who found it?
Upload2Shell is a vulnerability in Ghostscript, the program that reads PDFs and print files (PostScript and EPS). It affects every version before 10.08.0. It was found by GPT-5.6 Sol, OpenAI’s model, together with security researcher Paulos Yibelo of pwn.ai, who published the research on November 21, 2026.
It’s the second serious vulnerability found with GPT-5.6 Sol in a few weeks: PHP2Shell, the PHP vulnerability, was discovered with the same model.
What can an attacker do with Upload2Shell?
With a single file, the attacker makes the server that receives it run their commands. From there they can:
- read the site’s files, including the ones holding the database password and API keys;
- reach your users’ data through them;
- leave a hidden file so they can come back whenever they want.
They don’t need a password, and nobody has to click anything. In pwn.ai’s tests the attack worked on very different systems:
- Google: the servers that process files for Gmail, Drive, Google Chat and Google Docs. Google closed its path on November 10.
- WordPress: an author account was enough, the role that can upload files to the media library by default.
- WordPress plugins such as Forminator: any visitor was enough, with no account, through a public form that accepts PDFs.
How does the attack work, in plain terms?
You don’t see Ghostscript, but it sits behind many upload features. When a site creates a photo thumbnail or a PDF preview, the libraries it uses (Imagick in PHP, Pillow in Python) can hand the file to Ghostscript if they find a print format inside.
The attack exploits exactly that step:
- the attacker prepares a print file and names it
photo.png; - the site only looks at the name and accepts it;
- the program that builds the thumbnail looks inside, sees it’s a print file and passes it to Ghostscript;
- the instructions hidden in the file exploit the bug, break out of Ghostscript’s protection and run commands on the server.
That’s why the problem doesn’t depend on how well your site’s code is written. All it takes is an unpatched Ghostscript on the server and an uploaded file that reaches it.
How do you protect a web app from Upload2Shell?
There are four moves, depending on how your site is built. The prompts are written for people who aren’t developers: you paste them into Claude Code and it does the technical work.
1. I have a WordPress site: what should I do?
Update WordPress to at least 7.0.4 or 6.9.7. These versions closed WordPress’s path back in August, with the CVE-2026-65640 fix. Then write to your hosting provider today and ask whether the Ghostscript on their servers has the fix for CVE-2026-125396. Updating WordPress closes WordPress’s path, but the server’s Ghostscript is updated by your host.
2. I built the web app with Claude Code: how do I know if I’m at risk?
Open Claude Code in the project folder and paste this prompt:
Check whether this app is exposed to the Ghostscript vulnerability CVE-2026-125396 (Upload2Shell). Find every place where the app receives files from users and tell me whether they can reach Ghostscript, including through other libraries. For the installed version, check the distribution's security advisory, not just the version number. Answer in plain language and don't change anything.Claude Code looks for every place where users upload files in your web app and tells you whether those files can reach Ghostscript. The CVE number in the prompt matters: with just the name "Upload2Shell", Claude Code may not recognize the vulnerability. The line about the distribution’s advisory matters because Debian and Ubuntu patch packages without changing the main version number.
3. I’m at risk: how do I fix the web app?
If the first prompt tells you that uploaded files reach Ghostscript, give Claude Code this:
Protect this app from the Ghostscript vulnerability CVE-2026-125396 (Upload2Shell), fixed in version 10.08.0. Make sure uploaded files are accepted only if they really are images, by looking at their content and not their name, and remove or update Ghostscript if the app doesn't need it. Then prove it works: try uploading a harmless file that pretends to be a photo and show me it gets rejected, and a real photo that goes through. Explain what you did in plain language.This way Claude Code only accepts images that really are images and removes Ghostscript if it isn’t needed. Then it proves the fix works: a fake photo, even a harmless one, gets rejected, while a real photo goes through.
4. The site runs on my own server: what should I check?
If the site runs on your own server, have the containers checked too, meaning the boxes your app runs in. Updating the server doesn’t update the Ghostscript inside a container. A Docker image built months ago keeps using the old version.
On some distributions the fix isn’t out yet. As of November 24, 2026, Red Hat Enterprise Linux 7, 8, 9 and 10 are all listed as affected with no fix, and so are Amazon Linux 2 and Amazon Linux 2023. There, the only option is to remove Ghostscript if your apps don’t use it. Debian and Ubuntu already ship fixed packages.
The prompt to give Claude Code on the server:
Connect to my server and check which version of Ghostscript is installed, including inside every Docker container. If it doesn't have the fix for CVE-2026-125396, update it, or remove it if my apps don't use it. Before changing anything, tell me what you're about to do, and at the end check that the site still works.The prompt asks Claude Code to tell you what it’s about to do before touching the server: on a production machine, that’s the rule that matters most.
Is Upload2Shell already being used in attacks?
So far nobody has reported successful attacks: as of November 24, 2026 the vulnerability isn’t in CISA’s KEV catalog, the list of vulnerabilities already exploited in real attacks. But since November 22 there have been public exploits on GitHub, meaning ready-made files that run commands on unpatched servers. The gap between a public exploit and the first attacks is usually short.
As a developer with 10 years of experience, 5 of them in cybersecurity applied to software development, I can tell you this is the classic vulnerability that hits people who don’t even know they’re running the vulnerable program. If your site accepts photos or PDFs, run the check today: it takes a few minutes with Claude Code. And if you know someone whose site accepts uploads, send them this article.
Sources
- How We Hacked the Pipes — Upload2Shell (pwn.ai) — Paulos Yibelo’s research, November 21, 2026: GPT-5.6 Sol found the flaw with him; command execution on Google (Gmail, Drive, Chat, Docs), WordPress from the Author role, Forminator without an account; WordPress fixed in 7.0.4 and 6.9.7 (CVE-2026-65640); Ghostscript fixed in 10.08.0.
- CVE-2026-125396 (CVE record) — Published November 9, 2026: Ghostscript before 10.08.0, -dSAFER sandbox bypass.
- Re: Ghostscript 10.08.0 fixes multiple CVEs, including "upload2shell" (oss-security) — Message of November 21, 2026: WordPress had closed its path on August 12, Ghostscript fixed the flaw on September 8.
- CVE-2026-125396 (Red Hat Customer Portal) — Checked November 25, 2026: ghostscript "Affected" on RHEL 7, 8, 9 and 10, no fix.
- CVE-2026-125396 (Amazon Linux Security Center) — Checked November 25, 2026: "Pending Fix" on Amazon Linux 2 and 2023; Amazon Linux 2027 Preview fixed on November 19 (ALAS2027-2026-379).
- Debian Security Tracker, CVE-2026-125396 — Debian 12 fixed in 10.0.0~dfsg-11+deb12u9 (security repository), Debian 13 from 10.05.1~dfsg-1+deb13u2: fixes without changing the main version.
- Known Exploited Vulnerabilities Catalog (CISA) — Feed released November 24, 2026: CVE-2026-125396 is not in the catalog.
Want to know what this means for your product?
If you're building software with AI and want a second opinion on how you're working, tell me about your project.
Tell me about your projectFollow the blog
One email for every new article
I only write when an article is out: title, summary and link. You can unsubscribe with one click from any email.
RSS feed
An RSS feed is the up-to-date list of articles: add it to a reader app like Feedly or Inoreader and new articles show up there, no email needed.