cve.bz

CVE-2026-125396 (Upload2Shell) Ghostscript before 10.08.0 -dSAFER Bypass via .putgstringcopy .forceput Recovery

8.5 highEPSS 0.5%

Known as Upload2Shell

High (8.5) in artifexsoftware ghostpdl. EPSS 0.5% estimated probability of exploitation activity in the next 30 days.

On this page
Ghostscript before 10.08.0 contains a -dSAFER bypass vulnerability in the .putgstringcopy procedure in gs_fonts.ps, which calls the privileged .forceput operator without checking operand types. Attackers can supply crafted PostScript or PDF documents that trigger a type error, recover .forceput via a custom error handler, and cause a use-after-free across save/restore to execute arbitrary code.

Severity

CVSS 4.0

8.5 high
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

CVSS 3.1

7.8 high
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
0.5% (unchanged from 0.4% a week ago) estimated probability of exploitation activity in the next 30 days; 33rd percentile. Scored 2026-11-30. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2026-11-10. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-648 Incorrect Use of Privileged APIs
Published
Modified
Assigned by
VulnCheck (CNA)
NVD analysis
Awaiting analysis
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-125396 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-125396?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-125396?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-125396 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
ArtifexSoftware ghostpdlbefore 10.08.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12ghostscript10.0.0~dfsg-11+deb12u9DEBIAN-CVE-2026-125396 DLA-4914-1
Debian13ghostscript10.05.1~dfsg-1+deb13u2DEBIAN-CVE-2026-125396 DSA-6516-1
Debian14ghostscript10.08.0~dfsg-1DEBIAN-CVE-2026-125396
Ubuntu22.04:LTS, 24.04:LTS, 26.04:LTS and 4 moreghostscriptno fix listedUBUNTU-CVE-2026-125396
Red Hatenterprise_linux:8::appstreamlibgs, ghostscript0:9.27-21.el8_10RHSA-2026:103524
Red Hatenterprise_linux:9::appstreamlibgs, ghostscript0:9.54.0-20.el9_9.1RHSA-2026:103523
Red Hatenterprise_linux:10.3libgs, ghostscript0:10.02.1-17.el10_3.1RHSA-2026:103517
openSUSETumbleweedghostscript10.08.0-5.1openSUSE-SU-2026:12528-1
AlmaLinux8libgs, ghostscript, libgs-devel and 5 more9.27-21.el8_10ALSA-2026:103524
AlmaLinux9libgs, ghostscript, libgs-devel and 5 more9.54.0-20.el9_9.1ALSA-2026:103523
AlmaLinux10libgs, ghostscript, libgs-devel and 4 more10.02.1-17.el10_3.1ALSA-2026:103517
Rocky Linux8libgs, ghostscript, libgs-devel and 9 more0:9.27-21.el8_10RLSA-2026:103524
Rocky Linux9libgs, ghostscript, libgs-devel and 9 more0:9.54.0-20.el9_9.1RLSA-2026:103523
Rocky Linux10libgs, ghostscript, libgs-devel and 7 more0:10.02.1-17.el10_3.1RLSA-2026:103517

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · openSUSE.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This vulnerability is rated as an Important severity issue because circumventing the -dSAFER protection mechanism allows arbitrary code execution within the context of the executing application. In Red Hat Enterprise Linux environments, Ghostscript is commonly deployed to support print workflows, document viewers, and server-side conversion tasks. Although exploitation requires a user or service to process a maliciously crafted document, breaking the sandbox boundary defeats the primary isolation barrier protecting host systems from untrusted PostScript input.

Red Hat's mitigation

Operational controls and configuration hardening can reduce exposure to this vulnerability:

1. Restrict untrusted input:

Do not open or process PostScript or PDF files received from untrusted or unverified sources.

2. Sandboxing and container isolation:

When Ghostscript is used in automated document conversion or web pipelines, run the process within a restricted container, an unprivileged user namespace, or under a confined SELinux profile to restrict access to the underlying system in the event of sandbox escape.

3. Disable PostScript/PDF delegates in ImageMagick:

If Ghostscript is invoked via ImageMagick and PostScript/PDF conversion is not required, disable the relevant coders by adding the following line inside the <policymap> section of /etc/ImageMagick-6/policy.xml or /etc/ImageMagick-7/policy.xml:

<policy domain="coder" rights="none" pattern="{PS,PS2,PS3,EPS,PDF,XPS}" />

Caveats: Restricting document formats or enforcing sandbox isolation may cause failures in automated document rendering and printing workflows that depend on Ghostscript. If background daemons or web services cache ImageMagick policies, those services will need to be restarted for the policy changes to take effect.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10ghostscriptAffected
Red Hat Enterprise Linux 6ghostscriptOut of support scope
Red Hat Enterprise Linux 7ghostscriptAffected
Red Hat Enterprise Linux 8ghostscriptAffected
Red Hat Enterprise Linux 9ghostscriptAffected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-125396.

GitHub PoC

Repositories on GitHub named after this CVE or listed for it by the PoC-in-GitHub index. For those marked Harbor Check: matches CVE, Flawharbor read the code and found it implements this CVE's exploitation technique: read, not run, and its dependencies only checked for warning signs, so a pointer and no guarantee. The rest are unverified: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it. How Harbor Check reads them, and what it found.

  • DeathShotXD/Upload2Shell Harbor Check: matches CVE 14 stars, created
    Turn an anonymous IPP print job into command execution. A hands-on reproduction of CVE-2026-125396 through CUPS and Ghostscript.
  • evenomn/CVE-2026-125396-upload2shell Harbor Check: matches CVE 9 stars, Python, created
    CVE-2026-125396 Ghostscript -dSAFER 沙箱逃逸(Upload2Shell):独立逆向全指针链 / macOS+Linux 双平台复现 / 参数化 PoC 生成器 / WordPress 端到端打法
  • dinosn/upload2shell-poc-generator Harbor Check: matches CVE 8 stars, created
    OOB payload generator for CVE-2026-125396 (Ghostscript -dSAFER escape): Collaborator callback payloads for Ghostscript 9.26–10.07.1; inert …
  • Luscious8/Upload2shell Harbor Check: matches CVE 0 stars, created
    This package reproduces the *Upload2Shell* vulnerability (CVE-2026-125396) on your own machine so you can see the full remote chain with y…
  • 9bie/CVE-2026-125396-bomb 13 stars, Python, created
    CVE-2026-125396(upload2shell) bomb fuzz exploit
2 more

Attack patterns (CAPEC)

  • CAPEC-107 Cross Site Tracing Likelihood: Medium · Severity: Very High
  • CAPEC-234 Hijacking a privileged process Severity: Medium

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON