Heap-buffer-overflow in ghostscript: pdfi_dict_get_no_store_R_inner
Summary
OSV-2022-496: Heap-buffer-overflow in pdfi_dict_get_no_store_R_inner. Affects ghostscript versions >= 7a57a0db991ff9d38419961717c6ce1e3678db4c, < dd15cd3cd5495800de5ca5c8a152147b485e124f. Fixed in dd15cd3cd5495800de5ca5c8a152147b485e124f. 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 manipulating PDF files. The vulnerability in question, pdfi_dict_get_no_store_R_inner, is a heap-buffer-overflow issue that affects Ghostscript. This vulnerability allows an attacker to read beyond the bounds of a heap buffer, potentially leading to remote code execution or denial of service.
Vulnerability Detail
The pdfi_dict_get_no_store_R_inner vulnerability in Ghostscript is triggered when processing a PDF file. It occurs due to a heap-buffer-overflow read, which can be exploited by an attacker to access sensitive information or execute arbitrary code. The vulnerability was discovered through the OSS-Fuzz project, and the crash state indicates that the issue lies in the pdfi_dict_get_no_store_R_inner function, specifically in the pdfi_dict_get_no_store_R_key and pdfi_find_resource functions. The severity of this vulnerability is considered medium.
How To Fix
Minimum fixed version
dd15cd3cd5495800de5ca5c8a152147b485e124f
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 workaround, users can consider implementing input validation and sanitization measures to mitigate the risk of exploitation. Additionally, it is advisable to exercise caution when processing PDF files from untrusted sources.
Conclusion
The pdfi_dict_get_no_store_R_inner vulnerability in Ghostscript poses a medium-level security risk due to a heap-buffer-overflow read. Users are advised to update their installations to a version that includes the fix or apply input validation measures to mitigate the risk. For further assistance or support in 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 manipulating PDF files.
The vulnerability can potentially allow an attacker to execute arbitrary code or cause denial of service by exploiting the heap-buffer-overflow read.
This vulnerability was discovered through the OSS-Fuzz project, which focuses on fuzzing open-source software to uncover security vulnerabilities.
The severity of this vulnerability is considered medium.
To fix this vulnerability, it is recommended to update Ghostscript to a version that includes the fix. The fix was implemented in commit dd15cd3cd5495800de5ca5c8a152147b485e124f or later.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.