CVE-2026-125396

Description

A flaw was found in Ghostscript. An attacker can achieve arbitrary code execution by tricking a user or automated system into processing a maliciously crafted PostScript or PDF document. This issue occurs due to missing operand type validation during font handling operations, allowing an attacker to bypass the SAFER security sandbox and execute unauthorized code.

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.

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.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score7.8N/A7.8
Attack VectorLocalN/ALocal
Attack ComplexityLowN/ALow
Privileges RequiredNoneN/ANone
User InteractionRequiredN/ARequired
ScopeUnchangedN/AUnchanged
ConfidentialityHighN/AHigh
Integrity ImpactHighN/AHigh
Availability ImpactHighN/AHigh

Vector

Red Hat: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

cve.org: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Understanding the Weakness (CWE)

Access Control

Technical Impact: Gain Privileges or Assume Identity

An attacker may be able to elevate privileges.

Confidentiality

Technical Impact: Read Application Data

An attacker may be able to obtain sensitive information.

Integrity,Confidentiality,Availability

Technical Impact: Execute Unauthorized Code or Commands

An attacker may be able to execute code.

Frequently Asked Questions

Want to get errata notifications? Sign up here.