CVE-2022-2085
ghostscript: Null pointer dereference in gx_default_create_buf_device()
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · February 14, 2022
Updated · November 22, 2025
Description
A NULL pointer dereference vulnerability was found in Ghostscript, which occurs when it tries to render a large number of bits in memory. When allocating a buffer device, it relies on an init_device_procs defined for the device that uses it as a prototype that depends upon the number of bits per pixel. For bpp > 64, mem_x_device is used and does not have an init_device_procs defined. This flaw allows an attacker to parse a large number of bits (more than 64 bits per pixel), which triggers a NULL pointer dereference flaw, causing an application to crash.
Statement
This is a fairly hard case, as very few devices use more than 64 bits per pixel. The DeviceN device is one of the few that does, and then the problem only kicks in if the MaxBitmap figure is high enough (or conversely the resolution is low enough).
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 5.3CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H
CWE-476 · NULL Pointer Dereference