Welcome to our

Cyber Security News Aggregator

.

Cyber Tzar

provide a

cyber security risk management

platform; including automated penetration tests and risk assesments culminating in a "cyber risk score" out of 1,000, just like a credit score.

Upload2Shell (CVE-2026-125396): Ghostscript root cause, reachability, detection and patch guidance

published on 2026-11-23 00:51:26 UTC by Mayuresh
Content:

Upload2Shell (CVE-2026-125396) is a Ghostscript -dSAFER bypass in .putgstringcopy, and the fix has been public since September 8, 2026. The CVE only appeared on November 10. If you patched WordPress or Roundcube and stopped there, you closed one door into Ghostscript and left the others open. I read both Artifex commits, the WordPress changeset and every distribution tracker I could reach. Five things stood out that I have not seen written up elsewhere:

  1. Ghostscript 10.08.0 ships only the first fix. The C rewrite that removes .forceput from this code path (commit e0421767) is not in the 10.08.0 tag. The released fix is a type check in front of the same .forceput call.
  2. WordPress 7.0.4 still hands any file that starts with %PDF- to Imagick, and Imagick hands it to Ghostscript. The CNA says a crafted PDF can trigger this bug.
  3. If you applied Red Hat’s RHSA-2026:83551 for the two sibling Ghostscript CVEs last month, you are most likely still exposed to this one.
  4. The CNA score says local attack vector. The researcher’s own paths are an HTTP upload, an email attachment and an anonymous IPP print job.
Upload2Shell (CVE-2026-125396)

CVE-2026-125396 Ghostscript

  • CVSS v4 8.5, scored local, reachable over HTTP, SMTP and IPP
  • Public PoCs since November 22
  • EPSS 0.0013 to 0.0035 on November 22
  • Not in CISA KEV 2026.11.20, SSVC exploitation none

Patch to 10.08.0 or distribution build

Patch Ghostscript and verify by package version, not gs --version.

Root cause

CVE-2026-65640 WordPress Core

  • Needs upload_files, Author role or higher
  • Real PDF files still reach Ghostscript after the fix

7.0.4 or branch backport

Closes disguised PostScript, not the PDF path.

Entry point

CVE-2026-114727 Roundcube

  • Attachment content passed to ImageMagick on resize

1.6.20 or 1.7.5

Patch Roundcube and Ghostscript together.

Entry point

Upload2Shell at a glance, November 22, 2026

Upload2Shell (CVE-2026-125396): Root Cause

The bug is in .putgstringcopy, a ten-line PostScript procedure in Resource/Init/gs_fonts.ps that the font loader uses to store a string into a dictionary. This is the pre-fix code, the same lines the CVE record links at the ghostpdl-10.07.0 tag:

/.putgstringcopy  %   <dict> <name> <string> .putgstringcopy -
{ 2 index gcheck currentglobal
  2 copy eq {
    pop pop .forceput
  } executeonly {
    5 1 roll setglobal
    dup length string copy
    .forceput setglobal
  } executeonly ifelse
} .forcebind odef % must be bound and hidden for .forceput

Nothing checks the operand types. If length or copy fails on the wrong type, execution stops with the privileged .forceput next in line and the allocation mode still switched. That is my reading of the code. It fits the CNA text: a custom error handler recovers .forceput, and a use-after-free across save and restore follows. Artifex’s bug title says the result is native read and write and controlled dispatch.

The fix in 10.08.0 adds one type check in front of the same .forceput call. I confirmed this by dumping the compiled init code out of my 10.07.0 and 10.08.0 builds. Artifex also wrote a C replacement with no .forceput (commit e0421767), but it is not in the 10.08.0 release.

Upload2Shell (CVE-2026-125396) - Attack Path
Upload2Shell (CVE-2026-125396) – Attack Path

Upload2Shell (CVE-2026-125396): Reachability Analysis

The CNA scored this as a local attack. Nobody opens these files by hand on a server: a thumbnailer, a mail preview or a print filter does it on arrival. The researcher confirmed these paths:

Entry pointWhat the attacker needsGhostscript runs asApplication fix version
WordPress media uploadAn account with upload_files (Author or higher)Web server user7.0.4 and backports to 4.7.35
Roundcube attachment previewA mail the user openswww-data1.6.20, 1.7.5
CUPS shared queue on Debian 13Network reach to IPP, no loginlpNone; only Ghostscript fixes it

The same research reached Ghostscript through public upload widgets in Forminator and Essential Addons for Elementor, MediaWiki PdfHandler, DokuWiki, Mayan EDMS, ResourceSpace, Plesk’s Roundcube and a Google production renderer (fixed by Google on November 10). The trick is old: the application trusts the extension, ImageMagick trusts the first bytes, so holiday.png that starts with %! is rendered as PostScript.

WordPress 7.0.4 (changeset 63214) now refuses Imagick format prefixes such as PS:, PostScript-family extensions, PostScript, EPS and WPG magic bytes, and compressed files. It still loads any file that starts with %PDF-, through Imagick’s PDF coder, which uses Ghostscript. The CNA says a crafted PDF can trigger the bug. I have not seen that shown for Ghostscript 10.x, so treat an unpatched Ghostscript behind WordPress 7.0.4 as reachable by anyone who can upload a PDF.

Upload2Shell (CVE-2026-125396) - Attack Reachability
Upload2Shell (CVE-2026-125396) – Attack Reachability

In-process renderers (Pillow, libvips, Qt plugins) never start a gs process, so process-based detection does not see them.

Timeline: CVE-2026-125396 was assigned 63 days after the fix

The researcher found the bug on July 27 and told WordPress first, which is why WordPress shipped its fix 20 days before Artifex had a bug report. Artifex then took seven days from report to release. Everything after that was slow, and three vendors still had no released fix on November 22.

Upload2Shell (CVE-2026-125396) - CVE Timeline
Upload2Shell (CVE-2026-125396) – CVE Timeline

Days from the Ghostscript 10.08.0 release

  • Researcher finds the bug: -43
  • WordPress 7.0.4: -27
  • Artifex bug 709684 filed: -7
  • Debian DSA-6516-1: 17
  • Roundcube 1.6.20 and 1.7.5: 41
  • Ubuntu USN-8949-1: 43no CVE listed
  • CVE published: 63
  • First public PoCs: 75
  • Amazon Linux, SUSE Enterprise, RHEL: 75no released fix

Negative = before the release

As of November 22, 2026

Am I patched? Affected versions and the caveats

Status read from each vendor page on November 22, 2026. The last column is where “we already patched Ghostscript” goes wrong.

PlatformFixed buildCaveats
Ghostscript upstream10.08.0Everything before 10.08.0 is affected
Debian 13 trixie10.05.1~dfsg-1+deb13u3Still reports 10.05.1. The tracker also lists deb13u2 (DSA-6516-1); the researcher calls u3 the current fixed build
Debian 12 bookworm10.0.0~dfsg-11+deb12u9 (DLA-4914-1)deb12u8 is vulnerable
Debian forky, sid10.08.0~dfsg-2
Ubuntu 16.04 to 26.10USN-8949-1 builds (16.04 to 20.04 through Ubuntu Pro)Still report the old version, and Ubuntu’s CVE page still says Needs evaluation for every release
RHEL 10None for this CVERHSA-2026:83551 (10.02.1-16.el10_2.3) covers two sibling CVEs, not this one. Red Hat’s bug has no fixed version and the CVE page does not load
FedoraNone for this CVE yetThe October 16 update (10.05.0-7) names CVE-2026-39919 and CVE-2026-101258 only
openSUSE Tumbleweed10.08.0-5.1
SUSE Enterprise 12 SP5, 15 SP4 to SP7, 16In QA or in progressNo released update
Amazon Linux 2, 2023, 2027 PreviewPendingNo released update
WordPress7.0.4, 6.9.7 and every branch down to 4.7.35Real PDFs still reach Ghostscript
Roundcube1.6.20, 1.7.5

Container images, appliances and anything that bundles its own libgs carry their own version, which this table cannot show.

Public PoCs, and which checker you can trust

On November 22, 2026 I counted six GitHub repositories with the CVE or the nickname in their name, description or topics, plus two more that cover it inside a larger project. Every one is original work: no copied files, and no shared code beyond boilerplate.

PoC TypeRepositorySafety status
Exploit-side (PoC lab, payload generator, fuzzer)3Clear: no prebuilt binaries, no decode-and-run, no hard-coded callback hosts. Not scored, by design
Version checkers3Clear; lab-tested
Impact write-up1Clear
Detection hunt (KQL, CrowdStrike CQL)1Clear

The researcher’s own write-up also links a proof-of-concept PDF that demonstrates memory control without running commands.

I built four Ghostscript targets and ran every version checker against each, as an unprivileged user with no network: vulnerable 10.07.0, patched 10.08.0, patched with the version hidden, and back-patched (10.07.0 source with the 10.08.0 fix, still reporting 10.07.0, which is what a Debian or Ubuntu backport looks like).

Target (truth)Mahgal/upload2shell-checkashrafzaryouh/CVE-2026-125396tearbu/daily-vuln-lab
10.07.0 (vulnerable)VulnerableVulnerableVulnerable
10.08.0 (fixed)PatchedSafePatched
Version hidden (fixed)Unknown, exit code 0Cannot parse, exit code 2Unknown, exit code 1
Back-patched (fixed)VulnerableVulnerableVulnerable, with a backport warning

Three findings from the lab:

  • No public checker can tell a backport from a vulnerable build: They all read gs --version. On Debian and Ubuntu that means every patched host is reported vulnerable. Check the package version against the tracker instead.
  • Mahgal’s exposure check misses ImageMagick 6: Its parser splits delegate lines at =>, and ImageMagick 6 writes them as eps<=>pdf, so on stock Debian or Ubuntu it never reports the ImageMagick path into Ghostscript, the feature its README leads with.
  • Exit codes matter in CI: With the version hidden, Mahgal exits 0, so a pipeline treats an unknown host as clean.

Reliability scores use my published method (content 50, provenance 30, hygiene 20, content cap), compared within a class only. Owner account age, organization and commit signatures cannot be collected from my environment, so they are left out and the coverage is shown in the CSV.

Upload2Shell repository reliability scores

  • tearbu/daily-vuln-lab (scanner): 65backport warning in output
  • ashrafzaryouh/CVE-2026-125396 (scanner): 60backport note in README only
  • Mahgal/upload2shell-check (scanner): 50misses ImageMagick 6, exits 0 on unknown
  • 0xDTC/0xUPLOAD2SHELL-Impact-Analysis (docs): 90only repository in its class
  • indocanadian416/CyberDetect CD-033 (detection): 70queries not load-tested

Compare within a class only

Snapshot November 22, 2026; scanners lab-tested

How hard is it to exploit Upload2Shell (CVE-2026-125396)?

One crafted document, no traffic volume, no race and no heap grooming in the public sources. The researcher reproduced it on Ghostscript 9.54.0, 10.05.1 and 10.07.0. The gate in front of Ghostscript decides who can use it:

Shared CUPS queue

  • Network reach to IPP only

Mass scanning

Runs as lp. Fix this first if it exists on your network.

No login

Roundcube

  • The user opens the message

Targeted phishing

Runs as www-data.

A mail

WordPress

  • upload_files, or a plugin with a public upload field

Account needed

Runs as the web server user. Root needs a second bug.

Author role

Who can reach Ghostscript

Exploitation is not reported. CVE-2026-125396 is not in CISA KEV (catalog 2026.11.20, 1,790 entries), and CISA’s SSVC entry says exploitation none. The same catalog lists older bugs of this class, Ghostscript CVE-2017-8291 and ImageMagick CVE-2016-3714.

Detection

No request-level exploit detail is public, so the content rules look for the file-type mismatch and the two operator names in the CNA text, and the process rules hunt for what happens after. The full rules (YARA, Sigma, Zeek) are in my Sigma repository.

StageWhat to look forWhereTested
DeliveryPostScript, EPS or WPG magic bytes in a file named like an image or PDFUpload and mail temp directories (YARA)Yes, benign samples
DeliveryClear-text .forceput or .putgstringcopy in an uploaded fileYARAYes, benign samples
Deliveryapplication/postscript posted under an image name, or a PS: prefix in the file nameZeekNo
Triggergs running as www-data, apache, nginx or lpProcess creation (Sigma)Converts cleanly
Aftergs starting sh, curl or wgetProcess creation, Sysmon for Linux (Sigma)Converts cleanly

Read-only host triage. Judge the package version, not gs --version:

dpkg-query -W ghostscript libgs10 2>/dev/null; rpm -q ghostscript 2>/dev/null
find / -xdev \( -name 'libgs.so*' -o -name gs \) -type f 2>/dev/null
convert -list policy 2>/dev/null | grep -iE 'PS|PDF|EPS|XPS'
find /var/www -path '*uploads*' -type f \( -iname '*.png' -o -iname '*.jp*g' -o -iname '*.pdf' \) -print0 | xargs -0 file --mime-type | grep -i postscript
ps -eo pid,ppid,user,etime,cmd --forest | grep -B2 -A3 -E '[g]s |[m]agick|[c]onvert'

These miss compressed or obfuscated PostScript, files the thumbnailer already deleted, and in-process rendering.

What to do, in order

OrderActionOperational impact
1Copy upload and mail temp directories, /var/log/cups and web logs before you change anythingLow
2Patch Ghostscript everywhere, including container images and bundled libgs, then restart PHP-FPM, CUPS and queue workersMedium
3Patch WordPress and RoundcubeLow
4No fix yet (Amazon Linux, SUSE Enterprise, RHEL): deny PS, EPS, PDF and XPS in ImageMagick policy.xml, require login on CUPS queues, block outbound traffic from renderersHigh: PDF thumbnails and print-to-PDF stop
5After patching, rotate WordPress salts and end Roundcube sessionsMedium
6If gs started a shell: rebuild the host and rotate database credentials and wp-config.php secretsHigh

This is my advice and does not come from a vendor. None of the three vendors lists a workaround. Check the coder names your build exposes with magick -list format first:

<policy domain="coder" rights="none" pattern="{PS,PS2,PS3,EPS,EPI,EPSF,EPSI,EPT,PDF,XPS}" />
<policy domain="delegate" rights="none" pattern="*"/>
Upload2Shell (CVE-2026-125396) - decision_path
Upload2Shell (CVE-2026-125396) – decision path
Article: Upload2Shell (CVE-2026-125396): Ghostscript root cause, reachability, detection and patch guidance - published 8 days ago.

https://pentestit.com/upload2shell-cve-2026-125396-ghostscript-root-cause-detection/   
Published: 2026 11 23 00:51:26
Received: 2026 11 29 08:06:34
Feed: PenTestIT
Source: PenTestIT
Category: News
Topic: Security Tooling
Views: 3

Custom HTML Block

Click to Open Code Editor