Heap-use-after-free vulnerability in ghostscript
Summary
OSV-2022-1: Heap-use-after-free in pdfi_dereference. Affects ghostscript versions >= c7cd63be10c23c712921d9ad7359ddbe5d282e44, < 3f5a2b75b2914b41ee600ab6226f1b4061bf267e. Fixed in 3f5a2b75b2914b41ee600ab6226f1b4061bf267e. 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 converting PDF files. This vulnerability affects the ghostscript package and is related to a heap-use-after-free issue in the pdfi_dereference function. The vulnerability can be triggered when processing a specially crafted PDF file, leading to potential security breaches and system crashes.
Vulnerability Detail
The vulnerability originates from a heap-use-after-free read of 4 bytes. The crash occurs in the pdfi_dereference function, specifically in the pdfi_dict_next and pdfi_check_Resources functions. This vulnerability has been reported by OSS-Fuzz, and more details can be found in their bug report (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43268). The severity of this vulnerability is considered high.
How To Fix
Minimum fixed version
3f5a2b75b2914b41ee600ab6226f1b4061bf267e
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 untrusted or unknown PDF files with the vulnerable version of ghostscript. This can help mitigate the risk of exploitation until the package is updated.
Conclusion
In conclusion, the ghostscript package is vulnerable to a heap-use-after-free issue in the pdfi_dereference function. This vulnerability can be exploited by processing a specially crafted PDF file, potentially leading to security breaches and system crashes. It is recommended to update the ghostscript package to the latest version to mitigate this vulnerability. For further support on 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 converting PDF files.
A heap-use-after-free vulnerability occurs when a program attempts to access memory that has already been freed. This can lead to crashes, memory corruption, and potential security vulnerabilities.
This vulnerability can be exploited by crafting a malicious PDF file and tricking a user or system into processing it with the vulnerable version of ghostscript. This can lead to potential security breaches and system crashes.
Yes, this vulnerability has been fixed in version 3f5a2b75b2914b41ee600ab6226f1b4061bf267e or later of the ghostscript package.
The severity of this vulnerability is considered high.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.