Skip to main content
Vulnerability Database/CVE-2026-112177

CVE-2026-112177: Ghostscript Privilege Escalation Vulnerability

CVE-2026-112177 is a privilege escalation flaw in Ghostscript on Red Hat Enterprise Linux 8 that allows attackers to bypass security restrictions and access unauthorized files. This article covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-112177 Overview

CVE-2026-112177 is a sandbox bypass vulnerability in Ghostscript as shipped with Red Hat Enterprise Linux 8. The fix for CVE-2019-14869 was dropped during the rebase from Ghostscript 9.25 to 9.27, re-exposing unprotected .forceput operations inside the .charkeys procedure. An attacker who delivers a crafted PostScript file can bypass -dSAFER restrictions, read or write files outside permitted paths, and execute commands with the privileges of the Ghostscript process. The flaw is categorized under CWE-648: Incorrect Use of Privileged APIs.

Critical Impact

Processing an untrusted PostScript file can break out of the Ghostscript -dSAFER sandbox and execute arbitrary commands as the Ghostscript user.

Affected Products

  • Ghostscript as shipped with Red Hat Enterprise Linux 8
  • Ghostscript versions in the 9.27 branch that lack the CVE-2019-14869 remediation
  • Applications and services that invoke Ghostscript to render PostScript or PDF input

Discovery Timeline

  • 2026-10-20 - CVE-2026-112177 published to NVD
  • 2026-10-20 - Last updated in NVD database

Technical Details for CVE-2026-112177

Vulnerability Analysis

Ghostscript uses the -dSAFER option to restrict file system access and command execution when interpreting untrusted PostScript. The sandbox relies on PostScript dictionaries being protected so that privileged operators such as .forceput cannot overwrite security-sensitive entries. CVE-2019-14869 originally addressed insufficient protection of .forceput calls in the .charkeys internal procedure. During the rebase of Red Hat Enterprise Linux 8's Ghostscript package from upstream 9.25 to 9.27, that fix was not carried forward. The regression allows a crafted document to invoke .forceput against dictionaries that should remain read-only under -dSAFER.

Root Cause

The root cause is a privileged-API misuse regression. The .charkeys procedure performs internal .forceput operations without the hardening introduced for CVE-2019-14869. Because -dSAFER depends on these dictionaries being immutable, an attacker-controlled PostScript file can replace entries that the interpreter later trusts, defeating the sandbox boundary.

Attack Vector

Exploitation requires an attacker to supply a specially crafted PostScript file to a target that renders it with Ghostscript. Common delivery paths include document conversion pipelines, print spoolers, email-to-PDF gateways, and web applications that process user-uploaded documents. No authentication or user interaction beyond document processing is required. After the sandbox is bypassed, the attacker can read or modify files outside permitted paths and execute commands with the Ghostscript process's privileges.

No verified public exploit code is available. See the GitHub GhostPDL commit for the upstream remediation referenced by Red Hat.

Detection Methods for CVE-2026-112177

Indicators of Compromise

  • PostScript or EPS files containing references to .forceput, .charkeys, or attempts to redefine systemdict or userdict entries
  • Ghostscript processes (gs, gsc) spawning shells (/bin/sh, /bin/bash) or network utilities such as curl or wget
  • Unexpected file reads or writes outside the working directory of document conversion services
  • Core dumps or interpreter errors referencing .forceput originating from untrusted document processing

Detection Strategies

  • Inspect inbound PostScript and PDF content for operator strings tied to privileged dictionary manipulation (.forceput, .forceundef, .setsafe).
  • Alert on Ghostscript child processes that are not part of normal rendering, especially shells, interpreters, or outbound network tools.
  • Correlate Ghostscript execution with file access events outside the expected input and output directories.

Monitoring Recommendations

  • Log every invocation of gs with command-line arguments and parent process context from document conversion hosts.
  • Enable Linux auditd rules on execve for Ghostscript binaries and on open syscalls touching sensitive paths such as /etc, /root, and user home directories.
  • Forward Ghostscript and application telemetry to a centralized analytics platform to baseline normal rendering behavior and surface deviations.

How to Mitigate CVE-2026-112177

Immediate Actions Required

  • Apply the Ghostscript security update published by Red Hat for RHEL 8 as soon as it is available on affected hosts. Track status via the Red Hat CVE-2026-112177 advisory.
  • Inventory all services that invoke Ghostscript, including print, document conversion, and PDF rendering pipelines, and prioritize patching those exposed to untrusted input.
  • Restrict Ghostscript execution to a dedicated low-privilege account and confine it with SELinux, AppArmor, or a container sandbox.

Patch Information

Red Hat tracks remediation under Bugzilla #2555564 and the Red Hat CVE page. The upstream fix is reflected in the GhostPDL commit 485904772c5f0aa1140032746e5a0abfc40f4cef, which restores protection for .forceput operations in the .charkeys procedure. Install the vendor-supplied Ghostscript package update once released, then restart dependent services such as CUPS and document conversion workers.

Workarounds

  • Disable or block server-side rendering of untrusted PostScript and EPS content until a patched Ghostscript package is deployed.
  • Pre-filter uploads to permit only sanitized PDF content and reject raw PostScript at the application boundary.
  • Run Ghostscript inside a seccomp-filtered container or chroot that denies execve of shells and limits file system reach to the input and output directories.
  • Remove unused Ghostscript binaries from systems that do not require document rendering to reduce attack surface.
bash
# Configuration example: confirm installed Ghostscript version and apply RHEL 8 updates
rpm -q ghostscript
sudo dnf --refresh update ghostscript
systemctl restart cups

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.