Recently, open-source security was rocked by the discovery of an alarming Remote Code Execution (RCE) vulnerability within the Ghostscript document conversion toolkit—CVE-2024729510. Ghostscript is the engine behind many other Linux applications, making Ghostscript flaws like this one especially severe and impactful.
This particular vulnerability can compromise countless Linux systems worldwide. To help you understand and protect against this threat, I'll walk you through how this flaw works, its impact, and practical strategies for mitigating your risk.
CVE-2024-29510 is an RCE vulnerability that affects all versions of Ghostscript up to 10.03.0. Ghostscript is a crucial part of modern computing - rendering files for LibreOffice, GIMP, Inkscape, and Scribus while powering printing services via CUPS.
Ghostscript software contains a flaw that allows an attacker, using specially crafted Postscript files, to bypass safety checks provided by its dSAFER sandbox, a safety measure designed to stop unsafe operations when converting documents. Although enabled by default to prevent security breaches, attackers can alter strings related to uni print device arguments after the sandbox has started, execute commands without permission, and perform file I/O operations without security monitoring.
Exploiting this flaw could allow attackers to execute arbitrary commands, access sensitive files, and potentially gain control of affected systems. As a result, the efficacy of Ghostscript as a security measure is severely undermined, raising severe concerns for web applications or services using Ghostscript in document conversion or preview applications or previews indirectly or directly.
Can you imagine converting your Postscript documents into PDFs and getting hacked? Attackers are exploiting this bug in the wild by masking malicious Postscript files as harmless-appearing JPGs and passing them along to be processed by Ghostscript's vulnerable component. This allows attackers to gain shell access and subsequently compromise your entire system.
You can check if your systems are vulnerable to this flaw by running this Postscript file with the command:
ghostscript -q -dNODISPLAY -dBATCH CVE-2024-29510_testkit.ps
Ghostscript has been vulnerable to Remote Code Execution attacks in the past. CVE-2023-36664, for instance, was identified and patched, also concerning handling maliciously crafted files. Although efforts were undertaken to eliminate security holes posed by these RCE flaws, CVE-2024-29510 indicates the continuing struggle to ensure robust protection measures remain in place.
To combat the imminent risk presented by CVE-2024-29510, system administrators and users alike should immediately take various proactive and reactive steps.
Ghostscript released an update, version 10.03.1, that resolves CVE-2024-29510 and must be applied as soon as possible to mitigate risk. Depending on your distribution, additional patched versions may also be made available and must be swiftly applied as quickly as possible. Debian, Fedora, and Ubuntu have released security patch updates to mitigate this flaw.
Ghostscript released an update, version 10.03.1, that resolves CVE-2024-29510 and must be applied as soon as possible to mitigate risk. Depending on your distribution, additional patched versions may also be made available and must be swiftly applied as quickly as possible.
The discovery of CVE-2024-29510 in Ghostscript underscores the ongoing challenge of software security and the necessity of heightened vigilance. While immediate responses include patching affected systems, long-term solutions include regular security audits, rapid patch management, and building a culture of safety within all operational practices. Taking these proactive steps will allow administrators to safeguard their infrastructure against future security threats such as this latest Ghostscript vulnerability as well.