Stack-buffer-overflow in pdfi_open_CIDFont_substitute_file in ghostscript
Summary
OSV-2021-1806: Stack-buffer-overflow in pdfi_open_CIDFont_substitute_file. Affects ghostscript versions >= 75fbddf52051987287e62d13c659eb73ba16982f, < bd747c5c2d320cd80ce08f16627c70a77ff67978. Fixed in bd747c5c2d320cd80ce08f16627c70a77ff67978. 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 question, identified as OSV-2021-1806, affects the pdfi_open_CIDFont_substitute_file function in Ghostscript. This function is responsible for opening a substitute file for a CIDFont, which is a font format used in PDF files. The vulnerability allows for a stack-buffer-overflow WRITE, which can lead to a crash or potentially be exploited for arbitrary code execution.
Vulnerability Detail
The stack-buffer-overflow vulnerability in pdfi_open_CIDFont_substitute_file can be triggered when processing a specially crafted PDF file. An attacker could exploit this vulnerability to crash the application or execute arbitrary code with the privileges of the user running Ghostscript. The vulnerability was discovered through the OSS-Fuzz project, and the affected versions of Ghostscript have been identified. The severity of this vulnerability is classified as HIGH.
How To Fix
Minimum fixed version
bd747c5c2d320cd80ce08f16627c70a77ff67978
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
There is no known workaround for this vulnerability. It is recommended to update Ghostscript to a fixed version as soon as possible.
Conclusion
The stack-buffer-overflow vulnerability in pdfi_open_CIDFont_substitute_file in Ghostscript can lead to crashes or potential code execution. Users are advised to update their installations to a version that includes the fix for 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 documents.
A stack-buffer-overflow vulnerability occurs when a program writes more data to a stack buffer than it can hold, potentially overwriting adjacent memory. This can lead to crashes, code execution, or other security issues.
An attacker can exploit this vulnerability by crafting a malicious PDF file that triggers the stack-buffer-overflow when processed by Ghostscript. This can allow the attacker to crash the application or execute arbitrary code.
This vulnerability is classified as HIGH severity.
No, there is no known workaround for this vulnerability. It is recommended to update Ghostscript to a fixed version.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.