Register for the AI for Security Summit: Join Figma, Perplexity & Wiz

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 execute arbitrary code by supplying a crafted PDF containing a JPEG 2000 image with mismatched component subsampling factors. All Ghostscript versions before 10.08.0 are affected. 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 process_one_trunk function within base/sjpx_openjpeg.c. When a JPEG 2000 image embedded in a PDF declares multiple components with differing subsampling factors (non-samescale) and a sub-byte bit depth (bpp < 8), the code allocates a row buffer sized for packed output but iterates state->width times writing a full byte per column — rather than per sample — overflowing the allocation. This corrupts internal chunk-allocator metadata, enabling controlled memory corruption and ultimately code execution. The vulnerability was reported by Alex Thomas of Wordfence Argus (AI) and the fix, committed as 0a8bf88, corrects the loop counter to track samples rather than bytes and adds a guard rejecting unsupported BPS values (Ghostscript Commit, Github Advisory).

Impact

Successful exploitation allows an unauthenticated network attacker to achieve arbitrary code execution on any system running a vulnerable Ghostscript version, with full confidentiality, integrity, and availability impact on the affected host. Because Ghostscript is widely embedded in document processing pipelines, print servers, web applications, and content management systems, exploitation could enable lateral movement, data exfiltration, or ransomware deployment. No user interaction is required, making automated or mass exploitation feasible against exposed services that process untrusted PDF files (Github Advisory, Feedly).

Exploitability

As of the disclosure date, there is no public proof-of-concept exploit and no evidence of in-the-wild exploitation (Feedly). The EPSS score is reported as 0.0, reflecting the early stage of public awareness. The vulnerability has not been added to the CISA Known Exploited Vulnerabilities (KEV) catalog at this time. No threat actor attribution has been reported. The CVE was assigned by VulnCheck and the bug was tracked as Ghostscript bug #709666 (Ghostscript Bug).

Exploitation steps

  1. Craft a malicious PDF: Create a PDF document embedding a JPEG 2000 (JP2) image that declares multiple image components with mismatched subsampling factors (e.g., component 0 with dx=1, component 1 with dx=2) and a sub-byte bit depth (bpp < 8, such as bpp=4).
  2. Trigger vulnerable code path: Ensure the crafted JP2 image routes through the non-samescale, sub-byte-depth output path in process_one_trunk within base/sjpx_openjpeg.c when Ghostscript processes the PDF.
  3. Cause heap overflow: The vulnerable loop iterates state->width times writing one full byte per iteration into a buffer allocated for packed (sub-byte) output, overflowing the heap allocation and corrupting adjacent chunk-allocator metadata.
  4. Achieve code execution: Leverage the corrupted heap metadata to redirect execution flow — for example, by overwriting a function pointer or vtable entry — to attacker-controlled shellcode or a ROP chain.
  5. Deliver the payload: Submit the crafted PDF to any service that invokes Ghostscript for processing (e.g., a web-based PDF converter, print server, or document management system) to trigger remote code execution without authentication or user interaction (Ghostscript Commit, Github Advisory).

Indicators of compromise

  • Network: Unexpected outbound connections from Ghostscript-processing services to external IPs following PDF ingestion; large or malformed PDF uploads to document processing endpoints.
  • File System: Unexpected files written to Ghostscript working directories or temp folders; new executables or scripts created by the Ghostscript process user account.
  • Logs: Application or web server logs showing PDF submissions with embedded JPEG 2000 images immediately preceding crashes or anomalous process behavior; Ghostscript error output referencing sjpx_openjpeg.c or JPEG 2000 decode failures.
  • Process: Unusual child processes spawned by the Ghostscript (gs) process (e.g., shells, network utilities like curl, wget, or nc); Ghostscript process crashes (segmentation faults) when processing specific PDF files.

Mitigation and workarounds

Upgrade Ghostscript to version 10.08.0 or later, which contains the fix committed in 0a8bf88 (Ghostscript Release). If immediate patching is not possible, restrict PDF processing to trusted sources only and implement input validation or filtering to reject PDFs containing JPEG 2000 images with suspicious component configurations. Consider sandboxing Ghostscript processes to limit the impact of exploitation. Monitor vendor and OS distribution channels for updated packages (Github Advisory, Feedly).

Community reactions

The vulnerability was reported by Alex Thomas of Wordfence Argus (AI), indicating AI-assisted security research contributed to its discovery (Ghostscript Commit). Early social media activity on Mastodon noted the disclosure shortly after publication. Automated vulnerability tracking platforms (VulnDB, CVEFeed, radar.offseq.com) indexed the CVE within hours of disclosure, reflecting standard community monitoring of Ghostscript vulnerabilities given its broad deployment footprint.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Ubuntu

Unknown

bionic (esm-infra)

ghostscript

Unknown

devel

ghostscript

Unknown

focal (esm-infra)

ghostscript

Unknown

jammy

ghostscript

Unknown

noble

ghostscript

Unknown

resolute

ghostscript

Unknown

xenial (esm-infra-legacy)

ghostscript

Unknown

SourceThis report was generated using AI

Related Ghostscript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-39919CRITICAL9.3
  • Ghostscript logoGhostscript
  • ghostscript
NoNoSep 15, 2026
CVE-2025-59800MEDIUM5.5
  • Ghostscript logoGhostscript
  • ghostscript-debuginfo
NoYesSep 22, 2025
CVE-2025-59799MEDIUM5.5
  • Ghostscript logoGhostscript
  • ghostscript
NoYesSep 22, 2025
CVE-2025-59801MEDIUM4.3
  • Ghostscript logoGhostscript
  • ghostscript
NoYesSep 22, 2025
CVE-2026-6192LOW1.9
  • Ghostscript logoGhostscript
  • blender
NoYesApr 13, 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

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