Stack-buffer-overflow in pdfi_read_cff_dict in ghostscript
Summary
OSV-2021-1694: Stack-buffer-overflow in pdfi_read_cff_dict. Affects ghostscript versions >= 75fbddf52051987287e62d13c659eb73ba16982f, < 0c4e9f7312637d512fec2b806570bfbea9da1aff. Fixed in 0c4e9f7312637d512fec2b806570bfbea9da1aff. 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 PostScript and PDF files. The vulnerability, identified as OSV-2021-1694, affects the pdfi_read_cff_dict function in Ghostscript. This function is responsible for reading Compact Font Format (CFF) dictionaries in PDF files. The vulnerability allows for a stack-buffer-overflow WRITE 4, which can lead to a crash or potential code execution.
Vulnerability Detail
The vulnerability arises from a stack-buffer-overflow WRITE 4 in the pdfi_read_cff_dict function. This can be triggered when processing CFF dictionaries in PDF files. An attacker could exploit this vulnerability by crafting a malicious PDF file that triggers the overflow when parsed by Ghostscript. If successfully exploited, this vulnerability could lead to a crash or potentially allow arbitrary code execution.
How To Fix
Minimum fixed version
0c4e9f7312637d512fec2b806570bfbea9da1aff
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
No specific workaround has been provided for this vulnerability.
Conclusion
In conclusion, the vulnerability identified as OSV-2021-1694 affects the pdfi_read_cff_dict function in Ghostscript. It allows for a stack-buffer-overflow WRITE 4, which can result in a crash or potential code execution. Users are advised to update their Ghostscript installations to a version that includes the fix. 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 PostScript and PDF files.
The vulnerability can lead to a crash or potential code execution when processing malicious PDF files.
To fix this vulnerability, update your Ghostscript installation to a version that includes the fix.
No specific workaround has been provided for this vulnerability.
You can find more information about this vulnerability in the OSS-Fuzz report linked in the vulnerability details.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.