Upload2Shell Turns a WordPress Upload Into Remote Code Execution — What CVE-2026-65640 Means for Your Site

A Ghostscript flaw called Upload2Shell lets an Author-level upload — or a public Elementor form — run code on your server. The research landed November 17, the WordPress fix is 7.0.4, and here is the checklist I ran on my own sites the same night.

Upload2Shell Turns a WordPress Upload Into Remote Code Execution — What CVE-2026-65640 Means for Your Site
Upload2Shell Turns a WordPress Upload Into Remote Code Execution — What CVE-2026-65640 Means for Your Site — Technical Architecture & Overview

Table of Contents

I have patched a lot of WordPress vulnerabilities, and most follow the same pattern: a bad permission check, an update, a sigh of relief. Upload2Shell is not that kind of bug. The research landed on November 17, and it says this: somebody uploads an ordinary-looking file, the server renders a preview, and that preview runs code on the server. No admin login at all.

What Upload2Shell actually is

Upload2Shell is what researchers Paulos Yibelo and pwn.ai call a flaw in Ghostscript, the renderer for PDFs and PostScript documents. It is tracked as CVE-2026-125396, carries a CVSS 4.0 score of 8.5, and is fixed in Ghostscript 10.08.0. Every upstream release before that is vulnerable.

The flaw sits in Ghostscript's Type 1 font loader: a use-after-free bug, where the software keeps a reference to memory after releasing it, letting a crafted document control what lands there — and switch off Ghostscript's security checks.

One thing up front: this is research-demonstrated exploitation, not a confirmed wave of attacks. There is no confirmed exploitation in the wild, and CVE-2026-65640 is not in CISA's Known Exploited Vulnerabilities catalog. Patch now, while the window is still open.

How a font loader became a shell

PostScript is a programming language, not just a file format: rendering a file means running instructions from it. That is why Ghostscript has -dSAFER mode, meant to limit what those instructions can touch.

Upload2Shell undermines those limits through the font loader, which failed to check the type of data it received before an operation that could raise an error; that error path exposed a protected write document code was never supposed to control. Detection write-ups point to the .putgstringcopy and .forceput operators, and the researchers used the flaw to alter Ghostscript's security checks while -dSAFER was still enabled. The test commands then ran with the renderer's permissions, not automatically as root.

On a typical WordPress host, the web server account can read your wp-config.php and database credentials, so root is not required to ruin your week. The CVE record lists a local attack vector — but that rating describes the flaw at the interpreter level, while network-facing services hand remotely supplied files to that interpreter for you. The file just needs to be rendered.

The three doors: WordPress, Roundcube, and CUPS

The research demonstrated three ways to reach the same vulnerable renderer.

On WordPress, the researchers reached Ghostscript through the media preview process on a site using Imagick and ImageMagick: uploads generate previews and thumbnails, work that can pass through Ghostscript. WordPress tracks the core side as CVE-2026-65640, which requires media upload privileges — Author level and above by default.

On Roundcube webmail 1.7.2, the sender needed no account at all, and the recipient only had to view the message — not click or download the attachment. Roundcube's server generated a thumbnail, passed it through ImageMagick to Ghostscript, and the command ran as www-data.

On a print server, no recipient action was needed at all: on Debian 13, a shared CUPS queue accepted network print jobs without credentials and sent the test document to Ghostscript, and the researchers confirmed execution by writing a marker file as lp. Authentication blocked anonymous submission but did not repair the flaw. Three products, three paths, one renderer — so the fix has two halves.

Why WordPress sites are the soft target

WordPress is the biggest of the three doors, and the conditions are not exotic: your version is below 7.0.4, or below the equivalent backported security release for your branch, and your server uses Imagick with Ghostscript for image processing.

That second condition is the one most site owners have never checked: WordPress prefers Imagick over GD whenever the PHP extension is present, and most cPanel and managed hosts ship Ghostscript by default. If you have never checked, assume it is Imagick until you verify otherwise.

The WordPress side, CVE-2026-65640, carries a CVSS score of 8.8 and affects every version before 7.0.4. The attacker needs an account with the upload_files capability — Author or higher — and uploads a malicious PostScript file; when the server processes it through Imagick backed by Ghostscript, the attacker's code runs on your server. An Author account is the role guest posters get.

The Elementor angle: the public forms you forgot about

Here is the part that kept me up: certain public upload features in Forminator and Essential Addons for Elementor reached the renderer without a login, in the configurations the researchers tested. A visitor with no account could hand a malicious file to the same renderer through a form you built for quote requests.

That changes the threat model completely: the core issue needs an Author account, but the form path needs nothing but a public URL. If your site has a form that accepts file uploads into the Media Library, you are not waiting for an attacker to get an account — you are waiting for them to find the form.

I went through my own sites and found two forms I had forgotten about: an old "submit your guest post" form and a job application form that accepted CVs as PDFs. A PDF is a normal thing to upload to a form like that, and Ghostscript is exactly what renders PDFs — which is why "just update WordPress" is incomplete: the core update closes the Media Library route for logged-in users, but it does not fix the renderer underneath or audit your forms for you.

The fix: WordPress 7.0.4 and Ghostscript 10.08.0

Both halves of the fix already exist: WordPress fixed the core route in 7.0.4 and backported it to the 4.7 branch: 7.0.4, 6.9.7, 6.8.8, 6.7.7, 6.6.7, 6.5.10, 6.4.10, 6.3.10, 6.2.11, 6.1.12, 6.0.14, 5.9.16, 5.8.15, 5.7.17, 5.6.19, 5.5.20, 5.4.21, 5.3.23, 5.2.26, 5.1.24, 5.0.27, 4.9.31, 4.8.30, and 4.7.35.

If you are on WordPress 7.1.5 — which itself fixed twenty security issues, including an unauthenticated flaw that could lead to remote code execution — you already have the core fix. Verify anyway.

Ghostscript is fixed upstream in 10.08.0, and distributions can backport the same fix to older releases, so the version number alone is not enough to judge exposure — Debian 13 first shipped it in 10.05.1~dfsg-1+deb13u2. Check your vendor's package status for CVE-2026-125396; updating the host does not replace the Ghostscript inside a container or application bundle. Apply both updates: WordPress closes the Media Library route, and Ghostscript closes the renderer itself.

The checklist I ran on my own sites tonight

Here is exactly what I did, in order, on every WordPress site I manage — about twenty minutes per site, mostly waiting for updates.

First, I checked the WordPress version: in wp-admin, Dashboard then Updates shows it at the top, or wp core version over SSH. Below 7.0.4, or below your branch's patched release, update now — after a backup, files and database both.

Second, I checked whether Imagick and Ghostscript are in use: from SSH, php -m | grep -i imagick tells you if the extension is loaded, and if you are unsure about Ghostscript, ask your host whether the server's version is patched.

Third, I reviewed who can upload: in wp-admin, look at every account with Author or higher, and remove or demote the old contributor accounts from people who stopped writing years ago — every Author account is a potential upload path.

Fourth, I audited every public form that accepts files — the step that found my two forgotten forms. Check Forminator, Essential Addons for Elementor, and any other form plugin with an upload field, and ask whether each form needs files at all, and whether it needs PDFs and PostScript or only images. Restrict file types to the minimum.

Fifth, I looked at the logs: access logs, new plugins and themes, modified files, scheduled tasks, and unexpected database changes. The tell is specific — a Ghostscript process spawning a shell or a scripting interpreter is the signature of a successful sandbox escape, because Ghostscript converting uploads has no legitimate reason to create such child processes.

Sixth, I turned automatic updates back on where they had been switched off — the fix was backported to twenty-four branches because they expect a long tail of unpatched sites. Do not be in the tail.

If you cannot patch tonight

Sometimes patching has to wait — a client site mid-campaign, a host that controls updates, a plugin that breaks on the new version. If that is you, do these mitigations tonight. Disable Imagick and ImageMagick handling of PostScript and PDF for untrusted uploads, and stop generating PDF previews if your site does not need them: storing a file did not start Ghostscript in the researchers' tests — rendering it did — so trace the worker that makes the preview and verify it uses the patched package. Disable anonymous upload paths, require authentication for shared print queues, restrict the ImageMagick policy so PostScript and PDF coders are not handed to Ghostscript for untrusted input, and keep renderers isolated with least-privilege service accounts. None of this replaces the patch, but each removes a path an attacker would need.

Conclusion

Upload2Shell is a Ghostscript flaw with a WordPress-sized blast radius. The research is public, the fix is shipped, and there is no confirmed exploitation yet — but that lasts only until someone turns the research into a scanner and starts knocking on doors. Update WordPress to 7.0.4 or your branch's patched release, and Ghostscript to 10.08.0 or your distribution's backported fix, audit your public forms, and check your logs for the signature that matters: Ghostscript spawning a shell. The dangerous part was never the upload — it was the render — so audit the pipeline, not just the permission, and make sure the upload button on your contact form is not a door into your server.

FAQ

Am I affected if my site does not allow uploads?

Probably not through core, but check your forms first: the core issue needs an account with the upload_files capability, but public upload features in Forminator and Essential Addons for Elementor reached the renderer without a login in the researchers' tests. Any form that accepts files from visitors is an upload path, even with a locked-down Media Library.

Is Upload2Shell being exploited in the wild right now?

As of this writing, no. The research published on November 17 describes laboratory demonstrations, not confirmed attacks, and CVE-2026-65640 is not in CISA's Known Exploited Vulnerabilities catalog. Public tracking puts the exploitation probability at 1.9% for the WordPress issue and 0.1% for the Ghostscript issue.

Do I need to update Ghostscript too, or is updating WordPress enough?

Both. The WordPress 7.0.4 update closes the Media Library route for logged-in users, but it does not fix the renderer underneath — public forms, webmail thumbnails, and print queues can still reach a vulnerable Ghostscript. Update WordPress to 7.0.4 or your branch's patched release, update Ghostscript to 10.08.0 or your distribution's backported fix, and check the copies bundled inside containers and application bundles too.

I am already on WordPress 7.1.5. Am I safe?

You already have the WordPress core fix, because 7.1.5 came after 7.0.4. But verify rather than assume: check Dashboard, then Updates, and confirm the version yourself. And confirm your server's Ghostscript version with your host, because the core update does not patch the renderer.

What should I do about Elementor forms on my site?

Audit every form with a file upload field, especially ones built with Forminator or Essential Addons for Elementor. Ask whether each form needs to accept files at all, restrict allowed file types to the minimum, and check for plugin updates. A form that accepts PDFs from the public is your highest-priority upload path until Ghostscript is patched.

How would I know if my site was already hit?

Look for the signature of a successful sandbox escape: a Ghostscript process spawning a shell, a scripting interpreter, or a download utility — Ghostscript converting uploads has no legitimate reason to create those child processes. Also review your access logs, administrator accounts, new plugins and themes, modified files, scheduled tasks, and unexpected database changes. If anything is unexplained, restore from a clean backup and rotate your credentials.

Looking for more WordPress & Elementor tutorials?

Explore our complete directory of 53+ web performance, theme development, and Elementor architecture guides.

View Topic Sitemap XML Feed