Vulnerability DatabaseCVE-2026-125396

CVE-2026-125396: 
Ghostscript vulnerability analysis and mitigation

Overview

CVE-2026-125396 is a -dSAFER sandbox bypass vulnerability in Ghostscript (GhostPDL) before version 10.08.0, affecting the .putgstringcopy procedure in gs_fonts.ps. The flaw allows attackers to supply crafted PostScript or PDF documents that trigger a type error, recover the privileged .forceput operator via a custom error handler, and cause a use-after-free (UAF) condition across save/restore operations to execute arbitrary code. It was published on November 10, 2026, and was reported by researcher Paulos Yibelo. The vulnerability carries a CVSS v3.1 score of 7.8 (High) and a CVSS v4.0 score of 8.5 (High) (Github Advisory, Feedly).

Technical details

The root cause is an incorrect use of privileged APIs (CWE-648): the .putgstringcopy procedure in gs_fonts.ps (lines 1026–1035 in ghostpdl-10.07.0) calls the privileged .forceput operator without validating operand types, violating the principle that privileged operators must not be accessible to untrusted PostScript code (Github Advisory, GhostPDL Commit). An attacker crafts a PostScript or PDF document that deliberately triggers a type error in .putgstringcopy; a custom PostScript error handler then captures and reuses the .forceput reference, effectively escaping the -dSAFER sandbox. This recovered .forceput access is then leveraged to create a use-after-free condition across PostScript save/restore operations, ultimately enabling native read/write primitives and controlled code dispatch leading to remote code execution. Exploitation requires user interaction — a victim must open or process the malicious document — but no prior privileges are needed (GhostPDL Commit, Feedly).

Impact

Successful exploitation grants an attacker arbitrary code execution with the privileges of the Ghostscript process, resulting in full compromise of confidentiality, integrity, and availability of the affected system. An unauthenticated user who can submit PostScript or PDF documents for processing — for example, through a document conversion service, print pipeline, or web application — can achieve code execution without any prior credentials. Depending on the deployment context, this could enable lateral movement within a network, exfiltration of sensitive data processed by Ghostscript, or complete host takeover (Github Advisory, Feedly).

Exploitability

As of the time of disclosure, there is no public proof-of-concept exploit and no evidence of in-the-wild exploitation (Feedly). The NVD SSVC assessment confirms exploitation status as "none" and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The EPSS score is approximately 0.13% (3rd percentile), indicating a currently low probability of exploitation in the near term (Github Advisory). The vulnerability was reported by researcher Paulos Yibelo and is tracked under Ghostscript bug #709684 (GhostPDL Commit).

Exploitation steps

  1. Craft a malicious document: Create a PostScript or PDF file that defines a custom error handler ($error dict or handleerror) designed to capture and store a reference to the .forceput operator when a type error occurs.
  2. Trigger the type error: Include PostScript code that calls .putgstringcopy with operands of incorrect types. Because gs_fonts.ps does not validate operand types before invoking .forceput, this causes a type error during the copy operation.
  3. Recover .forceput via error handler: The custom error handler executes in response to the type error and extracts the .forceput operator reference from the error context, making it available to untrusted PostScript code — effectively bypassing the -dSAFER sandbox restriction.
  4. Trigger use-after-free: Use the recovered .forceput to manipulate memory across PostScript save/restore boundaries, creating a use-after-free condition that yields native read/write primitives.
  5. Achieve code execution: Leverage the read/write primitives to corrupt interpreter state or function pointers, redirecting execution to attacker-controlled code running with the privileges of the Ghostscript process (GhostPDL Commit, Github Advisory).

Indicators of compromise

  • File System: Unexpected or newly created files in directories writable by the Ghostscript process (e.g., temp directories, web upload directories); presence of crafted .ps or .pdf files containing unusual $error or handleerror redefinitions alongside calls to .putgstringcopy.
  • Process: Unusual child processes spawned by the Ghostscript (gs, gswin64c) process (e.g., shells, network utilities like curl, wget, nc); Ghostscript processes with abnormally high memory usage or crash dumps indicating memory corruption.
  • Logs: Application or web server logs showing submission of PostScript or PDF files to document processing endpoints from unexpected or external sources; Ghostscript error output referencing typecheck errors in gs_fonts.ps or .putgstringcopy followed by unexpected continued execution.
  • Network: Outbound connections from the Ghostscript process or its parent service to external IP addresses, particularly on non-standard ports, which may indicate post-exploitation callback or data exfiltration.

Mitigation and workarounds

The primary remediation is to upgrade Ghostscript (GhostPDL) to version 10.08.0 or later, which validates operand types in .putgstringcopy before invoking .forceput, preventing the error-handler recovery path (GhostPDL Commit, Github Advisory). Until patching is possible, organizations should restrict access to Ghostscript document processing endpoints to trusted sources only, implement network controls to limit document submission, and run Ghostscript processes with minimal required privileges in isolated environments (e.g., containers or sandboxes). Avoid processing untrusted PostScript or PDF documents with vulnerable Ghostscript versions.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

ghostscript: 10.0.0~dfsg-11+deb12u9

Fixed

sid

ghostscript: 10.08.0~dfsg-1

Fixed

trixie

ghostscript: 10.05.1~dfsg-1+deb13u2

Fixed

Ubuntu

Unknown

bionic (esm-infra)

ghostscript

Unknown

devel

ghostscript

Unknown

focal (esm-infra)

ghostscript

Unknown

jammy

ghostscript

Unknown

noble

ghostscript

Unknown

resolute

ghostscript

Unknown

xenial (esm-infra-legacy)

ghostscript

Unknown

RHEL / CentOS

Affected

RHEL 8

ghostscript.src

Affected

RHEL 9

ghostscript.src

Affected

RHEL 10

ghostscript.src

Affected

Source: This report was generated using AI

Related Ghostscript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-125396HIGH8.5
  • Ghostscript logoGhostscript
  • ghostscript.src
NoYesNov 10, 2026
CVE-2026-112177HIGH7.3
  • Ghostscript logoGhostscript
  • libgs-devel
NoYesOct 20, 2026
CVE-2026-107080MEDIUM6.5
  • Ghostscript logoGhostscript
  • openjpeg2.src
NoYesOct 26, 2026
CVE-2026-110133MEDIUM5.8
  • Ghostscript logoGhostscript
  • ghostscript-tools-fonts
NoYesOct 30, 2026
CVE-2026-112922LOW3.3
  • Ghostscript logoGhostscript
  • ghostscript-gtk-debuginfo
NoYesOct 30, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management