Critical Vulnerability in Ghostscript: Bypass of -dSAFER Restrictions
Summary
ALPINE-CVE-2019-14817: A flaw was found in, ghostscript versions prior to 9.50, in the .pdfexectoken and other procedures where it did not properly secure its privileged calls, enabling scripts to bypass -dSAFER restrictions. Affects ghostscript versions < 9.27-r4. Fixed in 9.27-r4. 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 interpreter for the PostScript language and for PDF. It is widely used for processing and rendering documents in various formats. The package is known for its ability to convert files, manage printing tasks, and support a range of graphic formats. However, certain versions of Ghostscript are vulnerable to a security flaw that allows malicious scripts to bypass security restrictions.
Vulnerability Detail
A flaw was found in Ghostscript versions prior to 9.50, specifically in the .pdfexectoken and other procedures. This vulnerability does not properly secure privileged calls, enabling scripts to bypass the -dSAFER restrictions. A specially crafted PostScript file could disable security protections, allowing unauthorized access to the file system or the execution of arbitrary commands. The CVSS score for this vulnerability is 7.8, indicating a high severity level.
How To Fix
Minimum fixed version
9.27-r4
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 temporary workaround, you can disable the execution of untrusted PostScript files by ensuring that the -dSAFER option is enforced in your Ghostscript commands. However, this does not fully mitigate the risk associated with this vulnerability.
Conclusion
The vulnerability in Ghostscript presents a serious risk, allowing unauthorized access and execution of commands through crafted PostScript files. It is crucial to update to the latest patched version to safeguard your systems. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.
See every vulnerability recorded for ghostscript →
FAQ
The vulnerability allows malicious scripts to bypass security restrictions, potentially leading to unauthorized access to the file system or execution of arbitrary commands.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.
Ghostscript versions prior to 9.50 are affected by this vulnerability. It is recommended to upgrade to version 9.27-r4 or later.
The CVSS score of 7.8 indicates a high severity level, meaning that the vulnerability poses a significant risk to systems using the affected versions of Ghostscript.
While the best solution is to update to a patched version, you can enforce the -dSAFER option to limit the execution of untrusted PostScript files as a temporary measure.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.