Heap-buffer-overflow in read_xref in ghostscript
Summary
OSV-2021-1781: Heap-buffer-overflow in read_xref. Affects ghostscript versions >= 75fbddf52051987287e62d13c659eb73ba16982f, < b0855fa22cd6ba447482ee2ae1c5e091428c4bc0. Fixed in b0855fa22cd6ba447482ee2ae1c5e091428c4bc0. 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. The vulnerability in question, identified as OSV-2021-1781, is a heap-buffer-overflow issue that affects the read_xref function in Ghostscript. This function is responsible for reading cross-reference tables in PDF files. By exploiting this vulnerability, an attacker could trigger a heap-buffer-overflow read of 8 bytes, potentially leading to a crash or arbitrary code execution.
Vulnerability Detail
The vulnerability originates from a heap-buffer-overflow read in the read_xref function of Ghostscript. This occurs when the function attempts to read more data than is available in the buffer, resulting in a read beyond the allocated memory. An attacker could craft a malicious PDF file that triggers this vulnerability when processed by Ghostscript. The impact of this vulnerability could range from a denial-of-service condition to potential remote code execution, depending on how it is exploited. 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 MEDIUM.
How To Fix
Minimum fixed version
b0855fa22cd6ba447482ee2ae1c5e091428c4bc0
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
At the moment, there is no known workaround for this vulnerability. It is recommended to apply the fix mentioned above by updating Ghostscript to a patched version.
Conclusion
The heap-buffer-overflow vulnerability in the read_xref function of Ghostscript can potentially lead to a crash or arbitrary code execution. It is crucial to update Ghostscript to a version that includes the fix for this vulnerability. Regularly updating the software is also recommended to address any future vulnerabilities. For further support and assistance 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 converting PDF files.
The impact of this vulnerability can range from a denial-of-service condition to potential remote code execution, depending on how it is exploited.
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 classified as MEDIUM.
At the moment, there is no known workaround. It is recommended to update Ghostscript to a patched version.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.