REDHAT-BUG-2533857: Buffer Overflow
Ghostscript before 10.08.0 contains a heap-based buffer overflow vulnerability in the JPEG 2000 output adapter (base/sjpxopenjpeg.c) that allows attackers to cause memory corruption by supplying a crafted PDF containing a JPEG 2000 image with mismatched component subsampling factors. When image components declare different subsampling values, the non-samescale sub-byte-depth output path allocates a row buffer sized for packed output but writes a full byte per output column regardless of bit depth, overflowing the allocation and corrupting internal chunk-allocator metadata to achieve code execution.
Affected Software
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Deployments using Artifex Ghostscript versions before 10.08.0 are affected when they process attacker-supplied PDFs containing JPEG 2000 images. The vulnerable code is in the JPEG 2000 output adapter.
What does an attacker need to exploit the vulnerability?
An attacker needs to supply a crafted PDF with a JPEG 2000 image whose components use mismatched subsampling factors. Exploitation occurs when Ghostscript processes the image through the non-samescale sub-byte-depth output path.
What is the likely impact of successful exploitation?
The crafted image can trigger a heap-based buffer overflow that corrupts internal chunk-allocator metadata. The described impact includes memory corruption and potential code execution.
How can I determine whether I need remediation?
Check whether your Ghostscript version is earlier than 10.08.0 and whether it processes PDFs from untrusted or externally supplied sources. Review the listed Red Hat errata for affected package updates in supported Red Hat environments.