Skip to content
Maintenance and security

A PDF Upload Can Take Over an Unpatched Server: Upload2Shell and WordPress

A Ghostscript flaw lets a crafted PDF run code on the server that makes its preview. What it means for WordPress, what to ask your host and which upload forms to check.

Harsh PrajapatiFull stack developer
Published
Reading time
8 min

A PDF Upload Can Take Over an Unpatched Server: Upload2Shell and WordPress

Upload2Shell is the name researchers at pwn.ai gave to CVE-2026-125396, a flaw in Ghostscript, a program servers use to read PDF and PostScript files. A crafted file can break out of Ghostscript's safety mode and run code on the server. The fix is Ghostscript 10.08.0, released on 8 September 2026 (opens in a new tab), or your Linux vendor's patched package. For a WordPress site, two things decide the risk: whether your server has an unpatched Ghostscript, and whether strangers can upload files that WordPress then turns into previews.

This article is for business owners and agencies who run WordPress. It reflects the sources as of 25 November 2026.

What Upload2Shell is, in plain words

Upload2Shell is a server problem that WordPress can expose, not a bug in WordPress itself. When a server makes a preview image of a PDF, it can hand the file to Ghostscript through ImageMagick (called Imagick from PHP).

Ghostscript has a safety mode called -dSAFER that is meant to stop a document from touching files or running commands. According to the Debian security tracker (opens in a new tab), Ghostscript before 10.08.0 has a way around that safety mode: a crafted PostScript or PDF file can trigger an error, recover a privileged operation and end up running arbitrary code. Put simply, a file that looks like a harmless PDF can make the server run the attacker's commands.

The pwn.ai research write-up (opens in a new tab), published on 21 November 2026, calls the issue Upload2Shell and shows it working against print servers, webmail and WordPress in test setups.

Key dates and versions

The fixes arrived in a different order from the news, so some sites are already protected and others are not.

Date (2026)What happenedSource
12 AugustWordPress 7.0.4 fixes an Author-level upload route that used Imagick and GhostscriptWordPress.org
8 SeptemberGhostscript 10.08.0 releasedGhostscript news page
9 NovemberCVE-2026-125396 published (US time, per the researchers)pwn.ai
21 Novemberpwn.ai publishes the Upload2Shell researchpwn.ai

The Debian tracker lists fixed packages for Debian 12, Debian 13 and unstable. Linux vendors can add the fix to an older version, so a server showing Ghostscript 10.05.1 may still be patched. Only the package release settles it.

What WordPress already fixed in 7.0.4

WordPress closed its own route into Ghostscript months before the Ghostscript CVE was public. The WordPress 7.0.4 release notes (opens in a new tab) list one security fix: "An authenticated Author+ remote code execution issue via malicious file upload on sites that use Imagick and Ghostscript reported by the team at pwn.ai". The fix was also released for older branches, from 6.9.7 back to 4.7.35. The pwn.ai write-up (opens in a new tab) gives that WordPress issue its own number, CVE-2026-65640.

If your site runs WordPress 7.0.4 or later, or the latest release in an older branch, the core upload path the researchers used is covered. If not, updating WordPress is the first job. The core fix does not patch Ghostscript on your server, though, so the server side still matters.

Public upload forms: what pwn.ai found

In our view, the serious case is a form that lets a visitor upload a file without logging in, on a server where that file reaches an unpatched Ghostscript. In the pwn.ai write-up, the researchers say they reached Ghostscript as a signed-out visitor through two plugin setups on WordPress 7.0.2:

  • Forminator 1.55.1, with a public form that accepted a PDF upload and stored it in the Media Library.
  • Essential Addons for Elementor Lite 6.7.0 with Elementor 4.2.0, using the Login/Register widget with an upload field and registration turned on.

These are the researchers' test setups. Neither vendor has said publicly that its plugin was affected or that a given version fixes it. The Forminator changelog (opens in a new tab) shows 1.58.6 on 16 November 2026 with the note "Security hardening", and Essential Addons 6.8.9 (opens in a new tab) on 15 November 2026 lists a "Security Enhancement" with no details. Keep both up to date, but no vendor says an update removes this risk.

Our own reading, not a finding from the research: any public form that accepts a PDF and puts it through WordPress's media handling could, in principle, take the same path. A patched Ghostscript fixes this flaw for every route.

  1. Visitor uploads a crafted PDF
  2. File saved to Media Library
  3. WordPress asks Imagick for a preview
  4. Old Ghostscript runs the file
  5. Attacker code runs on the server

What to ask your host this week

The first step is a short message to your host or server administrator, because Ghostscript is a server package they patch. Ask them:

  1. Is Ghostscript installed on the server or container that runs our site, and is it patched for CVE-2026-125396?
  2. Is the PHP Imagick extension enabled, and can it read PDF files?
  3. If a patched package is not available yet for our server, what interim protection do you have? One common host-level choice is an ImageMagick security policy (opens in a new tab) that stops it reading PDF and PostScript files, which is a decision for the host because it also stops PDF previews.
  4. Are there other copies of Ghostscript bundled inside containers or apps that a normal server update would miss?

The last question comes from the research itself: pwn.ai warns that host updates may not reach copies bundled inside containers or applications. If you run your own VPS, these questions are yours to answer; see VPS and cloud server management for what server patching involves.

Which upload fields to review

Next, list every place where someone outside your team can send you a file.

Where to lookWhat to check
Contact and quote formsDoes any field accept PDF or "any file"? Are uploads saved to the Media Library?
Registration and profile pagesCan new users upload a document or avatar during sign-up?
Job application formsCV uploads can be PDFs from strangers
Support or ticket formsAttachments from customers
User rolesWho has Author, Editor or upload rights, and do they all still need them?

For each one, ask whether the field is still needed, whether it must accept PDFs, and whether files need to go into the Media Library at all. Turning off a field you no longer use is the cheapest fix there is. Our article on WordPress plugin security best practices covers the habit of removing features and plugins you do not need.

The researchers also say a file's real type should be checked before it reaches the renderer. Their proof used a file named .pdf that actually contained PostScript, so a name check alone is not enough.

What not to panic about

Upload2Shell is serious, but it does not mean every WordPress site is open today.

  • It needs Ghostscript on the server. If your host does not have Ghostscript, or Imagick cannot read PDFs, this route does not apply.
  • No attacks are reported yet. As of 25 November 2026, we found no confirmed reports of attacks, and neither CVE-2026-125396 nor CVE-2026-65640 is in CISA's Known Exploited Vulnerabilities catalogue (opens in a new tab).
  • Do not uninstall plugins in a hurry. Removing a form plugin can lose saved entries and break pages. Review the upload settings first.
  • Do not edit server settings you do not understand. A wrong ImageMagick change can break image uploads for the whole site.

This flaw is similar in shape to PHP2Shell: the fix lives on the server, not in a plugin, so the conversation with your host matters more than the WordPress dashboard.

If you think your site was already hit

Signs of a break-in include admin users you did not create, unknown PHP files in the uploads folder, strange redirects or a host warning about unusual processes. Do not just delete the odd file and move on.

Take a backup of the current state, change passwords from a clean device, and follow a proper cleanup. Our WordPress hacked site cleanup guide explains the order of work, and emergency WordPress fixes covers cleanup when a site is already compromised.

A simple next step

In short, this is three small jobs: update WordPress, send your host the four questions above, and review every public upload field. For a monthly routine that tracks server packages, plugin notes and form settings, see website maintenance and support.

Frequently asked questions

Does updating Forminator or Essential Addons fix it?

We cannot say that. Both plugins have recent releases that mention security hardening, but neither vendor has said the release addresses this issue. The reliable fix is a patched Ghostscript on the server.

How do I know if my server has Ghostscript?

Look at Tools > Site Health > Info > Media Handling in WordPress, which may show a Ghostscript version line, then ask your host to confirm. A vendor package can be patched while still showing an older version number, so only the host can give a firm answer.

My site has no upload forms. Am I safe?

Your risk from visitors is lower. On WordPress 7.0.4 or later, the core Author-level route the researchers used is fixed, so what remains is any plugin or tool that passes uploaded files to Imagick. Keep WordPress and plugins updated, limit who can upload, and still ask your host to patch Ghostscript.

Sources

The facts in this article were checked against these pages, last reviewed 27 November 2026.

  1. Upload2Shell research, pwn.aipwn.ai/upload2shell/research.html
  2. CVE-2026-125396, Debian security trackersecurity-tracker.debian.org/tracker/CVE-2026-125396
  3. ImageMagick security policy, ImageMagickimagemagick.org/security-policy/
  4. Version 7.0.4, WordPress.org documentationwordpress.org/documentation/wordpress-version/version-7-0.4/
  5. Ghostscript news: version 10.08.0, Artifexghostscript.readthedocs.io/en/latest/News.html
  6. Forminator changelog, WordPress.orgwordpress.org/plugins/forminator/#developers
  7. Essential Addons for Elementor changelog, WordPress.orgwordpress.org/plugins/essential-addons-for-elementor-lite/#developers
  8. Known Exploited Vulnerabilities catalogue, CISAcisa.gov/known-exploited-vulnerabilities-catalog
Harsh Prajapati, the author

Written by

Harsh Prajapati

Freelance full stack developer, founder of Worklancio

Web developer since 2018, freelancing since 2022. Builds WordPress sites and plugins, web apps and CRMs from Ahmedabad.

You may also like