A critical vulnerability in the Ghostscript interpretation and rendering engine could allow remote code execution on servers that process specially crafted PDF files. The vulnerability is tracked as CVE-2026-39919 and exploits a heap buffer overflow when handling low-bit-depth JPEG 2000 images with differences in component resolutions.
Researchers from Defiant’s Wordfence platform discovered the flaw on August 23 using the AI-powered Argus system. According to testing, the malicious file can force Ghostscript to write 1,024 bytes to a buffer no larger than 256 bytes, causing memory corruption and theoretically enabling unauthenticated remote code execution under certain conditions.
How Is the Flaw Related to WordPress Sites?
WordPress can use the PHP Imagick extension to invoke ImageMagick when generating previews or thumbnails for PDF files, while ImageMagick relies on Ghostscript to perform the rendering. Therefore, uploading a PDF file could become an attack entry point if the attacker can upload the file and the system processes it automatically through the affected software chain.
Wordfence identified four main conditions for successful exploitation in WordPress environments: allowing the attacker to upload a PDF file, processing the file to create a preview, the processing chain reaching Ghostscript with policies that allow PDF rendering, and using an unpatched version of the engine. It noted that WordPress, in its default configuration, does not allow anonymous uploads to the media library.
Scope of Impact and Test Results
The affected range extends from Ghostscript versions 9.21 through 10.07.1 and is not limited to WordPress; any application that renders user-controlled PDF files through affected versions may be at risk. The researchers tested Linux environments including Debian, Ubuntu, Fedora, Alpine, and AlmaLinux, as well as an official WordPress Docker image, and found that all of them contained the affected code.
The two proof-of-concept attempts did not achieve remote code execution during 10,240 attempts on Linux packages in a laboratory environment, but the researchers succeeded in executing code on a server specifically configured for testing. Exploitation success also depended on modifications to fonts, language settings, font configuration, and a core system library, and execution was not always reliable.
What Should Operators Do?
Artifex released the fix on September 8 in Ghostscript 10.08.0, and the fixes were also backported to older versions. WordPress administrators should verify that their hosting provider is using version 10.08.0 or later and rebuild and redeploy Docker images that rely on older base images.
If updating is not possible, the guidance recommends blocking PDF uploads to the server or disabling PDF rendering in ImageMagick. As of the time of reporting, Wordfence said it had not observed exploitation of the vulnerability in real-world attacks.
Why Does This Matter?
The significance of the flaw lies in the fact that a PDF file, which appears to be a content input rather than a program, can reach a native component with processing privileges on the server. The existence of the vulnerability does not mean that every WordPress site is automatically vulnerable, as the risk depends on the upload and processing path, policy settings, and version in use. However, these conditions make updating Ghostscript and disabling the path when updating is not possible two direct measures for reducing the attack surface.