Ghostscript flaw lets hackers hijack servers via PDF uploads
Ghostscript heap overflow CVE-2026-39919 can enable remote code execution through crafted PDF uploads, with no exploitation seen yet.
Heap Buffer Overflow in Ghostscript JPEG 2000 Output Path Enables RCE
Ghostscript versions before 10.08.0 contain a heap-based buffer overflow in the JPEG 2000 output adapter (base/sjpx_openjpeg.c). When a crafted PDF embeds a JPEG 2000 image whose components declare mismatched subsampling factors, 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. Successful exploitation allows an attacker who can supply a document to the parser to achieve code execution with the privileges of the Ghostscript process, which is rated critical (CVSS 4.0: 9.3, network vector, no privileges or user interaction required). Any system or service that processes untrusted PDFs or images through Ghostscript is affected. No public proof-of-concept is known and the flaw is not listed in CISA's KEV, so exploitation is not currently observed.
What to do: Upgrade Ghostscript to 10.08.0 or later as soon as it is available from Artifex or your distribution's security channel (verify with `gs --version`). Audit and prioritize any service that renders or converts untrusted PDFs or images through Ghostscript — including print servers, document management systems, and image-processing APIs — since these are the realistic attack surface for a network-vector exploit with no authentication. As interim hardening, restrict which users or systems can submit documents to Ghostscript-based pipelines and monitor for crashes or anomalous behavior in gs processes until patched.
| Product | Affected |
|---|---|
| Artifex Software Ghostscript | before 10.08.0 (all versions prior to 10.08.0) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
Ghostscript before 10.08.0 contains a heap-based buffer overflow vulnerability in the JPEG 2000 output adapter (base/sjpx_openjpeg.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.
Ghostscript heap overflow CVE-2026-39919 can enable remote code execution through crafted PDF uploads, with no exploitation seen yet.
Wordfence disclosed Ghostscript CVE-2026-39919, a CVSS 9.8 flaw fixed in 10.08.0, with lab PDF remote code execution.
Today 1.5K readers · 2.8K views · 2.1K reads · all time 160K views