CVE-2026-39919: 
Ghostscript vulnerability analysis and mitigation

Overview

CVE-2026-39919 is a heap-based buffer overflow vulnerability in Ghostscript's JPEG 2000 output adapter (base/sjpx_openjpeg.c) that allows unauthenticated remote attackers to achieve arbitrary code execution by supplying a crafted PDF file. It affects all versions of Ghostscript (by Artifex Software) before 10.08.0. The vulnerability was disclosed on September 15, 2026, with a patch released in Ghostscript 10.08.0. It carries a CVSS v3.1 base score of 9.8 (Critical) and a CVSS v4.0 base score of 9.3 (Critical) (Github Advisory, Feedly).

Technical details

The root cause is a heap-based buffer overflow (CWE-122) in the non-samescale sub-byte-depth output path of the JPEG 2000 (JPXDecode) adapter in base/sjpx_openjpeg.c. When a PDF contains a JPEG 2000 image whose components declare different subsampling factors (dx/dy values), the code allocates a row buffer sized for packed output (accounting for sub-byte bit depths) but then writes a full byte per output column regardless of the actual bit depth. This causes the write pointer to overflow the allocation, corrupting internal chunk-allocator metadata in a manner exploitable for code execution. The fix, committed by Ken Sharp, corrects the inner loop to count samples rather than bytes and adds a guard rejecting unsupported BPS values (Ghostscript Commit, Github Advisory). The vulnerability was originally reported by Alex Thomas of Wordfence Argus (AI) (Ghostscript Commit).

Impact

Successful exploitation allows an unauthenticated, remote attacker to execute arbitrary code in the context of the Ghostscript process, resulting in full compromise of confidentiality, integrity, and availability of the affected system. Because Ghostscript is widely embedded in document processing pipelines, print servers, web applications, and CI/CD systems, exploitation could enable lateral movement within an organization's infrastructure. Sensitive data accessible to the Ghostscript process — including documents, credentials, and system files — may be exposed or modified (Github Advisory, Feedly).

Exploitability

As of the time of disclosure, there is no public proof-of-concept exploit and no evidence of active in-the-wild exploitation (Feedly). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The EPSS score is approximately 0.49–0.55%, placing it in roughly the 44th percentile for exploitation likelihood within 30 days (Github Advisory). No threat actor attribution has been reported. However, the vulnerability is rated automatable with total technical impact by NVD SSVC analysis, indicating high potential for weaponization if a PoC is developed (Feedly).

Exploitation steps

  1. Craft a malicious PDF: Create a PDF document embedding a JPEG 2000 (JP2) image where multiple image components are declared with mismatched subsampling factors (different dx/dy values per component) and a sub-byte bit depth (e.g., 1, 2, or 4 bpp). Tools such as OpenJPEG or custom JP2 file generators can be used to construct the malformed image stream.
  2. Trigger Ghostscript processing: Deliver the crafted PDF to a target system running a vulnerable version of Ghostscript (< 10.08.0). This can be done by submitting the file to a web application that processes PDFs (e.g., document converters, print services), emailing it to a mail server with PDF rendering, or placing it in a directory monitored by an automated pipeline.
  3. Trigger the overflow: When Ghostscript processes the JPEG 2000 stream via the JPXDecode filter, the process_one_trunk function in base/sjpx_openjpeg.c enters the non-samescale sub-byte-depth output path. The inner loop writes one full byte per output column instead of packing multiple samples per byte, overflowing the heap-allocated row buffer.
  4. Corrupt heap metadata: The overflow writes attacker-influenced data beyond the buffer boundary, corrupting Ghostscript's internal chunk-allocator metadata structures.
  5. Achieve code execution: By carefully controlling the content of the overflowing bytes (e.g., via the image component data values), an attacker can manipulate heap metadata to redirect execution flow, ultimately achieving arbitrary code execution under the privileges of the Ghostscript process (Ghostscript Commit, Github Advisory).

Indicators of compromise

  • File System: Unexpected PDF files with embedded JPEG 2000 streams in document processing directories; presence of new executable files, scripts, or web shells created by the Ghostscript process owner.
  • Process: Unusual child processes spawned by gs or ghostscript (e.g., /bin/sh, bash, curl, wget, python, nc); Ghostscript processes consuming abnormally high memory or crashing with segmentation faults.
  • Logs: Ghostscript error logs showing heap corruption messages, segmentation faults, or abnormal termination when processing specific PDF files; application logs recording processing of externally supplied PDFs immediately before unexpected crashes or anomalous behavior.
  • Network: Outbound connections from the Ghostscript process or its parent application to unknown external IP addresses, particularly on non-standard ports, following PDF processing events.

Mitigation and workarounds

The primary remediation is to upgrade Ghostscript to version 10.08.0 or later, which contains the fix committed in 0a8bf88 (Ghostscript Release). Linux distribution users should apply vendor-supplied security updates (e.g., Ubuntu USN-8791-1, Debian security advisories) as they become available. As a temporary workaround where immediate patching is not possible, restrict PDF processing to trusted sources only, and consider disabling or sandboxing Ghostscript's JPEG 2000 (JPXDecode) processing. Implementing strict input validation to reject PDFs with suspicious JPEG 2000 component configurations can also reduce exposure (Feedly).

Community reactions

The vulnerability received coverage from SecurityOnline.info and was mentioned in The Hacker News weekly security recap (SecurityOnline, The Hacker News). The Yocto Project security mailing list and AUSCERT also issued advisories referencing the issue. Community discussion on Mastodon (infosec.exchange) noted the critical severity rating. Overall, industry reaction has been measured, with no reports of active exploitation driving urgent public alarm.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

ghostscript: 10.0.0~dfsg-11+deb12u9

Fixed

sid

ghostscript: 10.08.0~dfsg-1

Fixed

trixie

ghostscript: 10.05.1~dfsg-1+deb13u2

Fixed

Ubuntu

Fixed

bionic (esm-infra)

ghostscript

Unknown

devel

ghostscript

Not Affected

focal (esm-infra)

ghostscript

Unknown

jammy

ghostscript: 9.55.0~dfsg1-0ubuntu5.14

Fixed

noble

ghostscript: 10.02.1~dfsg1-0ubuntu7.9

Fixed

resolute

ghostscript: 10.06.0~dfsg-3ubuntu1.1

Fixed

xenial (esm-infra-legacy)

ghostscript

Unknown

RHEL / CentOS

Fixed

RHEL 8

:appstream:ghostscript-0:9.27-18.el8_10.src

Fixed

RHEL 9

:appstream:ghostscript-0:9.54.0-19.el9_8.1.src

Fixed

RHEL 10

ghostscript-0:10.02.1-16.el10_2.1.src

Fixed

Alpine

Fixed

edge

ghostscript: 10.08.0-r0

Fixed

v3.21

ghostscript: 10.08.0-r0

Fixed

v3.22

ghostscript: 10.08.0-r0

Fixed

v3.23

ghostscript: 10.08.0-r0

Fixed

Source: This report was generated using AI

Related Ghostscript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-125396HIGH8.5
  • Ghostscript logoGhostscript
  • ghostscript.src
NoYesNov 10, 2026
CVE-2026-112177HIGH7.3
  • Ghostscript logoGhostscript
  • libgs-devel
NoYesOct 20, 2026
CVE-2026-107080MEDIUM6.5
  • Ghostscript logoGhostscript
  • openjpeg2.src
NoYesOct 26, 2026
CVE-2026-110133MEDIUM5.8
  • Ghostscript logoGhostscript
  • ghostscript-tools-fonts
NoYesOct 30, 2026
CVE-2026-112922LOW3.3
  • Ghostscript logoGhostscript
  • ghostscript-gtk-debuginfo
NoYesOct 30, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management