---
id: "CVE-2026-125396"
page: "https://infrastack.ai/live/CVE-2026-125396"
kind: "vulnerability"
aliases: ["CVE-2026-125396"]
title: "Ghostscript: crafted PostScript or PDF escapes -dSAFER and runs code"
severity: "high"
cvss: 8.5
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["ghostscript", "pdf-processing", "runtime", "self-hosted"]
not_affected_if: ["ghostscript-not-installed", "no-untrusted-input"]
published_at: "2026-11-10T00:17:13+00:00"
first_seen_at: "2026-11-10T00:28:44+00:00"
updated_at: "2026-11-10T00:29:51+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-125396", "first_seen_at": "2026-11-10T00:28:44+00:00"}]
exploit_sources: []
---

# Ghostscript: crafted PostScript or PDF escapes -dSAFER and runs code

Link for people: https://infrastack.ai/live/CVE-2026-125396 (this .md is for agents)

Ghostscript before 10.08.0 has a -dSAFER bypass in the .putgstringcopy procedure, which calls the privileged .forceput operator without checking operand types. A crafted PostScript or PDF file can trigger a use-after-free across save/restore and execute arbitrary code.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `gs --version` on each host or container that renders PostScript or PDF files, and compare against `10.08.0`.
- Look for Ghostscript in image builds, document converters and PDF pipelines, since it is often bundled as a dependency.

## Fix

- Ghostscript: move to `10.08.0` or later.

## Timeline

- 2026-11-10T00:28:44+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-125396

## Documents

- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/ghostscript-before-10.08.0-dsafer-bypass-via-putgstringcopy-forceput-recovery
- [fix] Patch: github.com https://github.com/ArtifexSoftware/ghostpdl/commit/1484854e0c8ddfda1baa4ad4cd965b8a9790aa81

## From the sources

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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
