Critical Path Traversal and Command Execution Vulnerability in Ghostscript
Summary
ALPINE-CVE-2024-33869: An issue was discovered in Artifex Ghostscript before 10.03.1. Affects ghostscript versions < 10.04.0-r0. Fixed in 10.04.0-r0. 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 powerful capabilities in handling graphics and text, making it a staple in many applications. However, it has been identified to have a vulnerability that allows for path traversal and command execution through crafted PostScript documents, which can lead to unauthorized access and execution of commands.
Vulnerability Detail
An issue was discovered in Artifex Ghostscript before version 10.03.1. The vulnerability arises from improper path reduction in the base/gpmisc.c file, allowing attackers to bypass restrictions on the use of %pipe%. This can lead to path traversal and command execution vulnerabilities when a malicious PostScript document is processed. The ramifications include potential unauthorized access to the system and execution of arbitrary commands, posing significant security risks.
How To Fix
Minimum fixed version
10.04.0-r0
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, avoid processing untrusted PostScript documents until the package is updated to a secure version. Additionally, consider implementing strict input validation and sanitization for any documents processed by Ghostscript.
Conclusion
The identified vulnerability in Ghostscript poses significant risks due to its ability to allow path traversal and command execution through malicious PostScript documents. It is crucial to update to the patched versions to mitigate these risks and ensure the security of applications utilizing Ghostscript.
See every vulnerability recorded for ghostscript →
FAQ
The vulnerability allows for path traversal and command execution through crafted PostScript documents.
You can use Vulert's playground at Vulert Scanner to check if your application is affected without requiring any signup.
Ghostscript versions before 10.03.1 are affected, specifically in Alpine v3.18 to v3.22.
As a workaround, avoid processing untrusted PostScript documents and implement strict input validation.
Detailed information can be found in the CVE report for ALPINE-CVE-2024-33869.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.