Heap Buffer Overflow Vulnerability in Ghostscript: OSV-2024-1391
Summary
OSV-2024-1391: Heap-buffer-overflow in gsicc_create_getv2buffer. Affects ghostscript versions >= 441c9e3a4ca08fa7f7c00063af33196b0d88ebaf, < da32171815f62653d90da4e9e0302f2e57ab3bd3. Fixed in da32171815f62653d90da4e9e0302f2e57ab3bd3. 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 rendering and converting documents in various formats. The package is known for its powerful capabilities in handling graphics and text, making it a popular choice for developers. However, like many software packages, it can be susceptible to vulnerabilities that may compromise its functionality and security.
Vulnerability Detail
The vulnerability identified as OSV-2024-1391 is a heap-buffer-overflow in the function gsicc_create_getv2buffer. This issue arises during the processing of ICC-based color spaces in PDF files. The heap-buffer-overflow can lead to unauthorized memory access, potentially allowing an attacker to execute arbitrary code or crash the application. The vulnerability was reported through OSS-Fuzz, highlighting its critical nature and the need for immediate attention.
How To Fix
Minimum fixed version
da32171815f62653d90da4e9e0302f2e57ab3bd3
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can avoid processing PDF files that utilize ICC-based color spaces until the update is applied. This can help mitigate the risk of exploitation until a permanent fix is implemented.
Conclusion
The heap-buffer-overflow vulnerability in Ghostscript poses significant risks to users and systems. It is crucial to update to the patched version to mitigate these risks. Additionally, using tools like Vulert can help maintain awareness of vulnerabilities in your software ecosystem.
See every vulnerability recorded for ghostscript →
FAQ
A heap-buffer-overflow occurs when a program writes more data to a buffer located on the heap than it was allocated for, potentially leading to memory corruption and security vulnerabilities.
You can check your version of Ghostscript by running gs --version in your terminal. If your version is between the introduced and fixed commits, it is affected.
The risks include potential arbitrary code execution, application crashes, and unauthorized access to sensitive data, which can compromise the integrity of the system.
Yes, you can use tools like Vulert, which monitors and alerts for open-source vulnerabilities in your software using just a manifest file like package-lock.json.
Detailed information about this vulnerability can be found in the OSS-Fuzz report at https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=384972943.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.