Sandbox Escape Flaw in Ghostscript Interpreter
Summary
CVE-2021-3781: A trivial sandbox (enabled with the -dSAFER option) escape flaw was found in the ghostscript interpreter by injecting a specially crafted pipe command. Affects ghostscript versions < 9.53.3-r1. Fixed in 9.53.3-r1. 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 interpreting documents in various applications. The vulnerability, identified as CVE-2021-3781, affects the Ghostscript interpreter when the -dSAFER option is enabled. This flaw allows an attacker to inject a specially crafted pipe command, leading to the execution of arbitrary commands on the system. The vulnerability poses a significant risk to the confidentiality, integrity, and availability of the affected system.
Vulnerability Detail
The vulnerability arises due to a trivial sandbox escape flaw in the Ghostscript interpreter. By exploiting this flaw, an attacker can inject a specially crafted pipe command into a document processed by Ghostscript. This allows the attacker to execute arbitrary commands on the system within the context of the Ghostscript interpreter. The consequences of this vulnerability include potential unauthorized access to sensitive information, unauthorized modification of data, and disruption of system availability.
How To Fix
Minimum fixed version
9.53.3-r1
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 disable the -dSAFER option in the Ghostscript interpreter. However, this workaround may introduce other security risks and is not recommended as a long-term solution. It is strongly advised to apply the official fixes or updates provided by the Ghostscript maintainers.
Conclusion
The sandbox escape flaw in the Ghostscript interpreter (CVE-2021-3781) poses a significant risk to the confidentiality, integrity, and availability of the affected system. It is crucial to promptly update the Ghostscript package to the recommended versions or apply the official fixes provided by the maintainers. Disabling the -dSAFER option can serve as a temporary workaround, but it is not a recommended long-term solution. For further assistance and support in 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 interpreting documents in various applications.
The vulnerability allows an attacker to execute arbitrary commands on the system within the context of the Ghostscript interpreter. This can lead to unauthorized access, data modification, and system disruption.
To fix this vulnerability, it is recommended to update the Ghostscript package to the specified versions for the respective Alpine versions. Alternatively, users can refer to the official Git repository for the latest fixes.
A temporary workaround is to disable the -dSAFER option in the Ghostscript interpreter. However, this may introduce other security risks and should not be considered a long-term solution.
For more information about this vulnerability, you can refer to the provided CVE identifier (CVE-2021-3781) or the official source mentioned in the vulnerability details.
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.