Skip to content
Threat Feed
high advisory

Ghostscript: -dSAFER bypass in .putgstringcopy procedure (CVE-2026-125396)

Ghostscript versions prior to 10.08.0 contain a -dSAFER bypass vulnerability in the .putgstringcopy procedure, allowing attackers to leverage a use-after-free condition to achieve arbitrary code execution via crafted PostScript or PDF files.

CVE search metadata

CVE search record: CVE-2026-125396. Severity: high. CVSS: 7.8. KEV: no. Product: Ghostscript (< 10.08.0). Brief: Ghostscript: -dSAFER bypass in .putgstringcopy procedure (CVE-2026-125396). Brief link: https://feed.craftedsignal.io/briefs/2026-11-ghostscript-dsafer-bypass/

Triage facts

Revision 1
Applicability
Ghostscript (< 10.08.0)
Evidence
Unknown
Severity
High
Action
Elevated
Sources
1 public source
Freshness
Revision 1Nov 10, 02:04 UTC
Vulnerabilities
1 CVE
Source quality
A1Likely

Ghostscript before version 10.08.0 is vulnerable to a -dSAFER bypass in the .putgstringcopy procedure located in gs_fonts.ps. The vulnerability arises because the procedure calls the privileged .forceput operator without validating operand types. An attacker can supply a specially crafted PostScript or PDF document that triggers a deliberate type error. By recovering the .forceput operator through a custom error handler, an attacker can manipulate memory to trigger a use-after-free condition during save and restore operations, leading to arbitrary code execution within the context of the Ghostscript interpreter.

Impact

Successful exploitation allows for arbitrary code execution in the context of the user or service running the Ghostscript interpreter. This is critical for applications that process untrusted user-supplied PostScript or PDF files (e.g., print servers, document converters, or automated imaging pipelines).

Recommendation

  • Update all installations of Ghostscript to version 10.08.0 or later immediately.
  • Audit applications that integrate Ghostscript to identify and isolate processing of untrusted document inputs.
  • Implement sandboxing for the Ghostscript process to limit the impact of potential code execution if immediate patching is not possible.

Immediate actions

Patch Ghostscript to 10.08.0 or later

IT Operations 48h

Threat Hunt

Identify applications utilizing Ghostscript to process external PDF or PostScript files for anomalous process behavior

T1203 high medium confidence hunt now

Data: Process lineage (Parent/Child relationship), Execution of shell commands or network connections spawned by ghostscript/gs processes

Mitigations

Upgrade Ghostscript to 10.08.0

immediate IT Operations

CVE-2026-125396