Negative-size-param vulnerability in ghostscript
Summary
OSV-2024-728: Negative-size-param in pdf_resize_resource_arrays. Affects ghostscript versions >= 441c9e3a4ca08fa7f7c00063af33196b0d88ebaf. No fix is published. 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 Adobe Portable Document Format (PDF). It is widely used for rendering PDF files and converting them to other formats. The vulnerability identified in Ghostscript allows an attacker to trigger a negative-size-param crash, leading to potential denial of service or arbitrary code execution.
Vulnerability Detail
The vulnerability arises from a negative-size-param crash in the pdf_resize_resource_arrays function. This crash occurs during the processing of cmap text in PDF files. An attacker can exploit this vulnerability by crafting a malicious PDF file that triggers the crash when parsed by Ghostscript. The impact of this vulnerability can range from crashing the application to executing arbitrary code with the privileges of the user running Ghostscript.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, users can consider disabling the processing of cmap text in Ghostscript. This can be achieved by modifying the configuration or command-line options to exclude the cmap text processing functionality. However, this workaround may impact the rendering of certain PDF files, so it should only be used as a temporary measure until the software is updated.
Conclusion
The negative-size-param vulnerability in Ghostscript can be exploited by an attacker to crash the application or execute arbitrary code. It is crucial to update Ghostscript to the latest version that includes the fix for this vulnerability. In the meantime, users can consider using the provided workaround to mitigate the risk.
See every vulnerability recorded for ghostscript →
FAQ
Ghostscript is an open-source interpreter for the PostScript language and the Adobe Portable Document Format (PDF). It is commonly used for rendering PDF files and converting them to other formats.
The vulnerability can result in a denial of service condition or allow an attacker to execute arbitrary code with the privileges of the user running Ghostscript.
To fix this vulnerability, it is recommended to update Ghostscript to the latest version that includes the patch for this issue.
As a temporary workaround, users can disable the processing of cmap text in Ghostscript. However, this may affect the rendering of certain PDF files.
More information about this vulnerability can be found in the OSS-Fuzz report linked in the vulnerability details.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.