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.
Wordfence researchers found CVE-2026-39919, a critical heap buffer overflow in Ghostscript 9.21 through 10.07.1 that can be triggered by a crafted PDF containing a JPEG 2000 image. Their proofs of concept wrote 1,024 bytes into a 256-byte buffer and achieved remote code execution on a purpose-built test server, although attempts against standard Linux packages failed. Artifex patched the issue in Ghostscript 10.08.0 on September 8, and Wordfence says it has not observed exploitation in the wild.
- CVE-2026-39919 is a Ghostscript heap overflow triggered by crafted PDFs.
- Affected releases are Ghostscript 9.21 through 10.07.1.
- Wordfence built proof-of-concept exploits but saw no in-the-wild use.
- Artifex fixed the flaw in version 10.08.0 on September 8.
Vulnerabilities mentionedAll →
- CVE-2026-399199.3—Heap Buffer Overflow in Ghostscript JPEG 2000 Output Path Enables RCEpublished · Artifex Software Ghostscript
| CVE | Vulnerability | CVSS | EPSS | Flags | Affected | Exposure | Published |
|---|---|---|---|---|---|---|---|
| CVE-2026-39919 | 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. |
Full article532 words · extracted from bleepingcomputer.com · click to collapse

A critical heap buffer overflow vulnerability (CVE-2026-39919) in the Ghostscript interpreter and rendering engine could allow remote code execution through specially crafted PDF files.
The flaw was discovered on August 23 by researchers at Defiant's platform Wordfence using their Argus AI-powered system.
Ghostscript is a PostScript and PDF interpreter that can render PDFs as images, generate thumbnails for previews, and optimize PDF files by compressing embedded images and removing unnecessary font data.
When generating a PDF thumbnail, WordPress can use the PHP Imagick extension to call ImageMagick, which launches Ghostscript.
A specially crafted PDF file containing a JPEG 2000 image can trigger incorrect handling of low-bit-depth samples and mismatched component resolutions.
Using Argus, the researchers developed two exploits for CVE-2026-39919 that force Ghostscript to write 1,024 bytes into a 256-byte buffer, corrupting nearby memory and leading to unauthenticated remote code execution in a WordPress deployment.
Wordfence focused on WordPress systems, but notes that the flaw affects any online system running Ghostscript 9.21 through 10.07.1 and is exploitable if the payload is adjusted to the environment.
The researchers tested ten Linux environments, including Debian, Ubuntu, Fedora, Alpine, and AlmaLinux, as well as an official WordPress Docker image snapshot, and found that all contained the vulnerable code.

Source: Wordfence
The researchers tested two proof-of-concept (PoC) exploits and found that their ability to trigger the vulnerability depended on the target environment.
In a lab testbed, they executed the exploits 10,240 times against Linux packages but failed to achieve remote code execution. However, they successfully executed code remotely on a purpose-built test server.
The researchers found that modifying the PDF's fonts, language settings, font configuration, and one core system library enabled the exploit to succeed, although not reliably.
In WordPress environments specifically, successful exploitation has four prerequisites:
- An attacker can upload a PDF, anonymously or through a low-privileged account.
- The site processes that PDF to generate a preview or thumbnail.
- The processing chain reaches Ghostscript, with the necessary software and policy settings permitting PDF rendering.
- Ghostscript contains the unpatched vulnerable decoding code.
Wordfence noted that stock WordPress does not permit anonymous Media Library uploads.
More generally, any application that renders attacker-supplied PDFs through affected Ghostscript code may expose the flaw, and authentication requirements for exploitation depend on the application.
Artifex, the maintainer of Ghostscript, rolled out a fix on September 8, in version 10.08.0 of the interpreter.
Fixes were also backported to older versions, so users should check the revision details for patch status.
WordPress administrators need to ensure, through their hosting provider, that Ghostscript has been upgraded to version 10.08.0 or later.
If using Docker, it is recommended to rebuild and redeploy with an updated, patched base image.
If unable to upgrade to a fixed Ghostscript release, it is recommended to block PDF uploads to the server or disable PDF rendering in ImageMagick.
Wordfence said it has not seen any in-the-wild exploitation of CVE-2026-39919 yet.
Build your security blueprint for AI-powered attacks
Join Mikko Hyppönen and security leaders from the NFL, CHANEL, and Atlassian for a two-hour digital summit on what AI-speed attacks change, what defenders should stop doing, and how to validate, decide, fix, and re-validate at machine speed.