Privilege Escalation in Ghostscript

ghostscript Updated 02 Oct 2025

Summary

15/11/2019
N/A
Yes i
High
8.8

CVE-2019-14869: A flaw was found in all versions of ghostscript 9.x before 9.50, where the .charkeys procedure, where it did not properly secure its privileged calls, enabling scripts to bypass -dSAFER restrictions. Affects ghostscript versions < 9.27-r5. Fixed in 9.27-r5. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Ghostscript is an open-source interpreter for the PostScript language and the PDF file format. It is widely used for rendering and manipulating documents. However, all versions of Ghostscript 9.x before 9.50 are vulnerable to a privilege escalation flaw. This flaw resides in the .charkeys procedure, which fails to properly secure its privileged calls. As a result, malicious scripts can bypass the -dSAFER restrictions and gain escalated privileges within Ghostscript. This can lead to unauthorized access to files outside of restricted areas or the execution of arbitrary commands.

Vulnerability Detail

The vulnerability, identified as CVE-2019-14869, allows an attacker to create a specially crafted PostScript file that exploits the flaw in Ghostscript. By leveraging this vulnerability, an attacker can escalate their privileges within the Ghostscript environment and perform unauthorized actions. This can include accessing sensitive files or executing arbitrary commands on the system. The impact of this vulnerability can be severe, potentially leading to data breaches, unauthorized system modifications, or further exploitation of the compromised system.

How To Fix

Minimum fixed version

9.27-r5

This is the first release that contains the fix.

sudo apk add --upgrade ghostscript

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a workaround, users can consider implementing additional security measures such as restricting access to Ghostscript and its associated files. This can be achieved by applying proper file system permissions and access controls. Additionally, it is advisable to review and validate any PostScript files before processing them with Ghostscript to mitigate the risk of exploitation.

Conclusion

The privilege escalation vulnerability in Ghostscript can have severe consequences, allowing attackers to gain unauthorized access or execute arbitrary commands. It is crucial to update Ghostscript to the latest version and implement additional security measures to mitigate the risk. For further assistance with vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for ghostscript →

Share this vulnerability

FAQ

Ghostscript is an open-source interpreter for the PostScript language and the PDF file format. It is commonly used for rendering and manipulating documents.

The vulnerability allows an attacker to escalate their privileges within the Ghostscript environment, potentially leading to unauthorized access to files or the execution of arbitrary commands.

To fix this vulnerability, update Ghostscript to version 9.50 or later. Regularly updating the software is recommended to stay protected against potential security vulnerabilities.

As a workaround, users can restrict access to Ghostscript and its associated files by applying proper file system permissions and access controls. Additionally, validating PostScript files before processing them can help mitigate the risk of exploitation.

For further support on vulnerability remediation, you can reach out to info@devnack.com.

Related vulnerabilities

Recent vulnerabilities recorded for ghostscript.

How To Fix

Minimum fixed version

9.27-r5

This is the first release that contains the fix.

sudo apk add --upgrade ghostscript

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback