Stack-buffer-overflow in pdfi_read_cff_dict in ghostscript
Summary
OSV-2023-88: Stack-buffer-overflow in pdfi_read_cff_dict. Affects ghostscript versions >= 441c9e3a4ca08fa7f7c00063af33196b0d88ebaf, < 8cfe505e168185fecd1b573711c68252aefb9f77. Fixed in 8cfe505e168185fecd1b573711c68252aefb9f77. 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 documents. The vulnerability in the pdfi_read_cff_dict function of Ghostscript allows for a stack-buffer-overflow, which can lead to a crash or potential code execution. This vulnerability was discovered through the OSS-Fuzz project.
Vulnerability Detail
The vulnerability arises from a stack-buffer-overflow in the pdfi_read_cff_dict function of Ghostscript. An attacker can exploit this issue by providing a specially crafted PDF file, triggering the overflow and potentially executing arbitrary code. The severity of this vulnerability is rated as HIGH. The vulnerability was introduced in commit 441c9e3a4ca08fa7f7c00063af33196b0d88ebaf and fixed in commit 8cfe505e168185fecd1b573711c68252aefb9f77.
How To Fix
Minimum fixed version
8cfe505e168185fecd1b573711c68252aefb9f77
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 opening untrusted PDF files or limit the usage of Ghostscript to trusted sources only. This can help mitigate the risk of exploitation until the vulnerability is fixed.
Conclusion
In conclusion, the stack-buffer-overflow vulnerability in the pdfi_read_cff_dict function of Ghostscript can lead to a crash or potential code execution. It is crucial to update Ghostscript to a fixed version and take necessary precautions to mitigate the risk. For further assistance 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 documents.
The vulnerability occurs due to a stack-buffer-overflow in the pdfi_read_cff_dict function of Ghostscript. An attacker can exploit this by providing a specially crafted PDF file.
The vulnerability can lead to a crash or potential code execution, depending on how it is exploited. This could allow an attacker to take control of the affected system.
Yes, the vulnerability has been fixed in commit 8cfe505e168185fecd1b573711c68252aefb9f77 or later versions of Ghostscript.
To protect yourself, it is recommended to update Ghostscript to a version that includes the fix. Additionally, avoid opening untrusted PDF files or limit the usage of Ghostscript to trusted sources.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.