Ghostscript NULL Pointer Dereference Vulnerability - CVE-2022-2085

ghostscript Updated 02 Oct 2025

Summary

16/06/2022
N/A
Yes i
Medium
5.5

UBUNTU-CVE-2022-2085: A NULL pointer dereference vulnerability was found in Ghostscript, which occurs when it tries to render a large number of bits in memory. Affects ghostscript versions < 9.55.0~dfsg1-0ubuntu5.1. Fixed in 9.55.0~dfsg1-0ubuntu5.1. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Ghostscript is an interpreter for the PostScript language and for PDF. It is widely used for rendering documents and converting them between formats. The package is essential for applications that require document processing capabilities. However, it has been found to be vulnerable to a NULL pointer dereference, which can lead to application crashes when handling certain image formats.

Vulnerability Detail

A NULL pointer dereference vulnerability was identified in Ghostscript, specifically when it attempts to render images with a high number of bits per pixel (bpp). This occurs during buffer device allocation, where the system relies on an undefined prototype for devices using more than 64 bits per pixel. An attacker can exploit this flaw by sending specially crafted input, leading to a crash of the application. The vulnerability is classified with a CVSS score of 5.5, indicating a moderate risk level.

How To Fix

Minimum fixed version

9.55.0~dfsg1-0ubuntu5.1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade ghostscript

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can limit the input to Ghostscript to ensure that it does not process images with more than 64 bits per pixel. This may involve modifying the source of the documents being processed or implementing checks before passing data to Ghostscript.

Conclusion

The Ghostscript NULL pointer dereference vulnerability (CVE-2022-2085) poses a moderate risk to applications that utilize this package for document processing. It is crucial to update to the latest patched version to ensure the security and stability of your applications. Utilize tools like Vulert to monitor for vulnerabilities in your software.

See every vulnerability recorded for ghostscript →

Share this vulnerability

FAQ

CVE-2022-2085 is a vulnerability in Ghostscript that allows for a NULL pointer dereference, potentially crashing the application.

You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to analyze your manifest file.

Exploitation of this vulnerability can lead to application crashes, which may disrupt services that rely on Ghostscript for document processing.

Yes, a patched version of Ghostscript is available. Update to version 9.55.0~dfsg1-0ubuntu5.1 or later to mitigate the risk.

If immediate updates are not possible, consider implementing input validation to restrict the processing of images with high bits per pixel as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for ghostscript.

How To Fix

Minimum fixed version

9.55.0~dfsg1-0ubuntu5.1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade ghostscript

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback