Null-dereference READ in load_glyph in ghostscript
Summary
OSV-2022-456: Null-dereference READ in load_glyph. Affects ghostscript versions >= 697d39ae1a842a3b67cf12e88e9a0cb6587a30fb, < 640d33e19e3d58a9c71c2fd6c44187cb4a242d2b. Fixed in 640d33e19e3d58a9c71c2fd6c44187cb4a242d2b. 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 affects the load_glyph function within Ghostscript. This function is responsible for loading and rendering glyphs (characters) in a document. The vulnerability allows for a null-dereference read, leading to a crash. This vulnerability was discovered through the OSS-Fuzz project.
Vulnerability Detail
The null-dereference read vulnerability in load_glyph can be triggered when processing certain documents. An attacker could potentially exploit this vulnerability to cause a denial-of-service (DoS) condition by crashing the Ghostscript interpreter. The crash occurs in the gs_fapi_ft_get_char_raster_metrics and gs_fapi_do_char functions. This vulnerability was reported to the Ghostscript team through the OSS-Fuzz project.
How To Fix
Minimum fixed version
640d33e19e3d58a9c71c2fd6c44187cb4a242d2b
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 avoid processing untrusted or unknown PostScript or PDF files with Ghostscript. By only processing trusted documents, the risk of exploitation can be mitigated. Additionally, users can consider using alternative PDF rendering libraries until the vulnerability is fixed.
Conclusion
The null-dereference read vulnerability in load_glyph within Ghostscript can lead to a crash in the interpreter, potentially causing a denial-of-service (DoS) condition. It is crucial to update to the latest version of Ghostscript (9.55.0 or later) to fix this vulnerability. Users should also exercise caution when processing untrusted documents and consider alternative PDF rendering libraries if necessary. 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.
The vulnerability allows for a null-dereference read, leading to a crash in the Ghostscript interpreter. This can result in a denial-of-service (DoS) condition.
This vulnerability was discovered through the OSS-Fuzz project, which performs continuous fuzz testing on various open-source projects.
Yes, the vulnerability has been fixed in Ghostscript version 9.55.0. Users are advised to update to the latest version to ensure they are protected.
Users can mitigate the risk by avoiding processing untrusted or unknown PostScript or PDF files with Ghostscript. They can also consider using alternative PDF rendering libraries until the vulnerability is patched.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.