Skip to content Sharpsoft

Ghostscript flaw CVE-2026-125396: a disguised photo can take over the web server – how to check WordPress, webmail and hosting

· Reading time: 3 min

Rating: This week

Act this week if your website accepts pictures or PDFs, or your team reads mail in the browser: attack instructions have been public since 22 Nov 2026, no attacks are known yet. Without a website or webmail it hardly affects you.

Updated:

In short: Ghostscript, a program over 35 years old found on many web servers, has a serious flaw (CVE-2026-125396): a file disguised as a photo can take over the server as soon as it makes a preview. Updates exist for WordPress, Roundcube and many servers; ask your hosting provider.

Does this affect me?

In short: a server is affected if Ghostscript runs alongside the image program ImageMagick (in PHP: Imagick) and the server makes previews of files from the internet: WordPress with an upload field or the media library, webmail such as Roundcube, hosting with Plesk or cPanel. Ghostscript reads PostScript (a language for printers) and PDF. ImageMagick recognises a file by its content, not its name: a «photo» can be a program. Check WordPress in two minutes, logged in as administrator: 1. Dashboard › «Updates»: WordPress 7.1.5 or later (older branches: 7.0.9, 6.9.12 or 6.8.13 or later). 2. «Tools › Site Health › Info › Media Handling»: if «Active editor» shows WP_Image_Editor_Imagick and «Ghostscript version» shows a number, both programs are there; the number does not show whether the fix is in, only the hosting provider knows. «Not available» or WP_Image_Editor_GD is a good sign for WordPress but does not replace the provider’s answer; «Unable to determine if Ghostscript is installed» means: ask the provider. 3. Does a public form accept files, such as job applications, quote requests or damage reports? 4. Does anyone read mail in the browser through the provider’s webmail? Result: Imagick, a Ghostscript number and an upload field or webmail: ask the hosting provider today. Otherwise: ask anyway, because webmail and other programs on the server call Ghostscript directly.

What can happen?

A file that looks like a photo but contains a PostScript program (PostScript is a language for printers) breaks out of Ghostscript’s protected mode and runs commands on the server as soon as it makes a preview; in the test with Roundcube webmail and a permissive ImageMagick setting, opening the mail was enough. Whoever gets onto the server this way can change the website, read form data and mail, and drop more malware. No attacks are known yet, but instructions have been public since 22 November.

What to do?

  1. Today: send the text below to your hosting provider or web agency and ask for a written answer within two working days. Good: a package version with a date, «Ghostscript is not installed» or «PostScript and PDF are blocked in ImageMagick since …». Red flags: «Ghostscript 10.0, so safe», «-dSAFER is on», «we check the file extension», «WordPress is up to date, that is enough».
  2. This week: update WordPress and all plugins (7.1.5 or later). Set public upload fields so files do not go into the media library, and accept only the formats you need. Webmail: Roundcube 1.7.7 or 1.6.22 or later; with Plesk and cPanel, the latest update.
  3. For specialists: Step by step, with the guide, the trace check and the background.

Text for your IT provider

Hello, because of the Ghostscript flaw CVE-2026-125396 («Upload2Shell»), please answer me in writing within two working days: 1. Do ImageMagick or Imagick and Ghostscript run on our server? 2. Which Ghostscript package version, with the fix since when? 3. If there is no update yet: are PostScript, EPS and PDF blocked in the ImageMagick policy? 4. Which webmail, in which version? 5. Were PHP, the web server and webmail restarted, and our account checked for unknown PHP files since 21 Nov? Thank you.

No Sharpsoft websites affected

The details

CVE number
CVE-2026-125396
Type of flaw
Bypass of Ghostscript’s -dSAFER protected mode (CWE-648): a crafted PostScript or PDF document, even disguised as a picture, runs commands with the rights of the web server or webmail as soon as a preview is made.
Affected versions
Ghostscript before 10.08.0 with ImageMagick or PHP Imagick; paths: WordPress before 7.0.4 / 6.9.7 / 6.8.8, Roundcube before 1.6.22 / 1.7.7, hosting with Plesk or cPanel
Update
Fixed in version Ghostscript 10.08.0 or later or the distribution’s fixed package; WordPress 7.1.5 or later; Roundcube 1.7.7 or 1.6.22 or later and later
Severity
8.5 out of 10 (CVSS 4.0, the usual scale for security flaws), BSI «high»; attack instructions public since 22 Nov 2026, no attacks known (Source: pwn.ai (21 Nov 2026), CVE record (9 Nov 2026), BSI (22 Nov 2026))
Advisories
pwn.ai: «Upload2Shell» research report
CVE-2026-125396
BSI: WID-SEC-2026-4424, rated «high» (German)
WordPress 7.0.4 with the core fix
Roundcube: releases 1.7.7 and 1.6.22
Plesk: note on Roundcube and Ghostscript
Debian: package status
AlmaLinux: packages and workaround
CloudLinux: status and workaround
Swiss FADP Art. 24: reporting data security breaches
Play the video (loads YouTube): Ghostscript flaw CVE-2026-125396: a disguised photo can take over the web server – how to check WordPress, webmail and hosting

Watch the Short on YouTube

Change history

  1. : Videos added
  2. : First published

For specialists

Step by step

  1. Inventory: where do ImageMagick, PHP Imagick and Ghostscript run? The server’s package list, in WordPress «Site Health › Media Handling», in Plesk «Tools & Settings › PHP Settings» (Imagick ships with Plesk PHP by default).
  2. Fixed packages (as of 23 Nov 2026): Ghostscript 10.08.0 or later; Debian 13 10.05.1~dfsg-1+deb13u2 or later; Debian 12 10.0.0~dfsg-11+deb12u9 or later, only from bookworm-security; Ubuntu 26.04 / 24.04 / 22.04 10.06.0~dfsg-3ubuntu1.2 / 10.02.1~dfsg1-0ubuntu7.10 / 9.55.0~dfsg1-0ubuntu5.15 or later (USN-8949-1); Alpine 3.21–3.24 10.08.0-r0 or later.
  3. No released update yet: RHEL 7–10, Rocky, CloudLinux, Amazon Linux, SUSE Enterprise; AlmaLinux only in the testing repository (packages with «.alma.1»). Block the Ghostscript formats there until the update.
  4. Workaround: in the ImageMagick policy (policy.xml), block the formats PS, PS2, PS3, EPS, PDF and XPS and the gs delegate, then restart PHP-FPM and the web server. Side effect: no PDF previews. -dSAFER does not protect, that is exactly the protection the flaw bypasses. On RHEL-8-based Plesk servers, check the effective policy from within PHP or ask Plesk support.
  5. The version number alone says nothing: distributions patch without a new number, and a fixed Debian 13 server still shows 10.05.1. Only the package version counts.
  6. After the update, restart all long-running services (PHP-FPM, Apache or Nginx, webmail, converter services), or the old library keeps running. Pull container images again and restart.
  7. WordPress: 7.1.5 or later (or 7.0.9 / 6.9.12 / 6.8.13 or later). The core fix since 7.0.4 / 6.9.7 / 6.8.8 (CVE-2026-65640) blocks PostScript before Imagick; the two tested plugin paths (Forminator storing in the media library, Essential Addons with an upload in the registration form) run through the same core function. Plugins that call Imagick themselves (PDF previews, image optimisers) are not covered by the core fix.
  8. Roundcube: 1.7.7 or 1.6.22 or later; 1.6.22 is the last 1.6 release. Plesk currently ships Roundcube 1.6.21 (since 18.0.81 Update 8 and 18.0.82 Update 3) and does not update Ghostscript: the operating system package stays with whoever runs the server. cPanel: the latest update.
  9. Upload fields: do not put files from public forms into the media library and do not generate previews; accept only the formats you need. Checking the file extension is not enough, ImageMagick goes by content.
  10. Traces: unexpected PHP files in upload folders (wp-content/uploads) and webmail temp folders, new admin accounts, changed files and unusual processes of the web server user since 21 Nov 2026. Treat any hit as a find (last step); without a hit, the update and restart are still needed.
  11. The same update 10.08.0 also fixes CVE-2026-39919 (JPEG 2000 files, 9.8 out of 10).
  12. If something is found: take the website offline, preserve evidence, rebuild from a clean backup, replace all passwords and keys (database, admin, interfaces). Hosting providers and agencies tell the customer as soon as possible (Art. 24 para. 3 FADP); if the risk to people is high, the customer reports to the FDPIC.

How the attack works

Ghostscript reads PostScript and PDF and runs in -dSAFER mode for protection. Before version 10.08.0, an internal routine (.putgstringcopy in gs_fonts.ps) calls a privileged function without a type check; a crafted document leaves the protected mode this way and runs commands with the rights of the calling program (CWE-648). ImageMagick and PHP Imagick recognise the format by content, not by name: a «.jpg» file with PostScript inside reaches Ghostscript as soon as the server makes a preview; storing it alone triggers nothing. pwn.ai showed three paths: WordPress core from author rights (closed on 12 Aug 2026 in 7.0.4 / 6.9.7 / 6.8.8, CVE-2026-65640), two form plugins without login (tested on WordPress 7.0.2) and Roundcube webmail with a permissive ImageMagick setting, where opening the mail was enough. Timeline: 8 Sep Ghostscript 10.08.0; 21 Oct Ubuntu update; 9 Nov CVE published; 17 Nov Debian 12; 21 Nov research public; 22 Nov five public attack projects, BSI «PoC recorded», AlmaLinux in testing; 23 Nov Roundcube 1.7.7 and 1.6.22, CERT-FR warning on Roundcube. Rating: 8.5 out of 10 (CVSS 4.0), BSI «high»; not on CISA’s list of exploited flaws, no warning from the Swiss Federal Office for Cyber Security (FOCS), no Swiss hosting provider has commented publicly (as of 23 Nov 2026). Earlier cases of the same kind are on CISA’s list: CVE-2017-8291 (Ghostscript) and CVE-2016-3714 (ImageTragick).

About the author

Luc Baumann is a Senior Software Architect and AI specialist. With Sharpsoft in Düdingen (FR), he builds and runs websites for small businesses across Switzerland. Here he writes about security flaws and scams that affect SMEs, clearly and with sources.

Also in Deutsch, Français

Feeds: RSS · Atom