Privilege Escalation in Ghostscript
Summary
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 ↓
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.
No signup required · Results in about 60 seconds
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 →
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.