Critical Ghostscript vulnerability allows server takeover via PDF uploads

Heap buffer overflow flaw CVE-2026-39919 affects many Linux distributions and WordPress environments

By LineZotpaper
Published
Read Time2 min
A critical heap buffer overflow vulnerability in the widely used Ghostscript interpreter could allow attackers to take over servers by uploading specially crafted PDF files, researchers at Wordfence have discovered. The flaw, tracked as CVE-2026-39919, affects all versions of Ghostscript from 9.21 through 10.07.1 and was patched on September 8 in version 10.08.0.

The vulnerability lies in incorrect handling of JPEG 2000 images within PDFs. Improper processing of low-bit-depth samples and mismatched component resolutions can cause Ghostscript to write 1,024 bytes into a 256-byte buffer, corrupting memory and enabling remote code execution.

Wordfence researchers, using their Argus AI-powered system, developed two proof-of-concept exploits that achieve unauthenticated remote code execution in a WordPress deployment. However, success depends on the target environment. They tested ten Linux distributions—including Debian, Ubuntu, Fedora, Alpine, and AlmaLinux—alongside an official WordPress Docker image snapshot, and found all contained the vulnerable code.

In lab tests, the exploits failed to achieve remote code execution in 10,240 attempts against standard Linux packages but succeeded on a purpose-built test server. Modifying the PDF's fonts, language settings, font configuration, and one core system library improved reliability.

For WordPress environments specifically, four conditions must be met: an attacker can upload a PDF (anonymously or via a low-privileged account); the site processes the PDF to generate a preview or thumbnail; the processing chain reaches Ghostscript with necessary software and policy settings; and Ghostscript contains the unpatched vulnerable decoding code. Stock WordPress does not allow anonymous Media Library uploads. More broadly, any application that renders attacker-supplied PDFs through affected Ghostscript may be exposed.

Artifex, the maintainer of Ghostscript, released a fix in version 10.08.0 on September 8. Fixes were also backported to older versions. WordPress administrators should ensure through their hosting provider that Ghostscript has been upgraded to version 10.08.0 or later. Docker users should rebuild and redeploy with an updated base image. If upgrading is not possible, blocking PDF uploads or disabling PDF rendering in ImageMagick is recommended.

Wordfence has not observed any exploitation in the wild so far.

§

Analysis

Why This Matters

  • Millions of web servers and applications using Ghostscript for PDF processing could be at risk of full compromise via a single file upload.
  • The vulnerability is critical (heap buffer overflow leading to remote code execution) and patching is straightforward, but many systems may remain unpatched for extended periods.
  • Researchers demonstrated reliable exploitation in controlled environments, increasing the likelihood of real-world attacks once proof-of-concept code circulates.

Background

Ghostscript is a widely deployed PostScript and PDF interpreter used by applications to render PDFs as images, generate thumbnails, or optimize files. It is often called indirectly through ImageMagick, which in turn may be invoked by content management systems like WordPress when users upload PDFs. The software has a long history of security vulnerabilities, making prompt patching essential.

Key Perspectives

  • Researchers (Wordfence): The flaw is critical and exploitable, though reliability varies by environment. Their AI system, Argus, enabled efficient discovery and exploit development.
  • Maintainers (Artifex): The fix was issued relatively quickly after disclosure (August 23 discovery, September 8 patch). Users are urged to upgrade to version 10.08.0 or apply backports.
  • System Administrators and Hosting Providers: The burden of patching falls on those managing Ghostscript installations. Docker users must rebuild images, and organizations may need to weigh mitigation options that could break PDF processing functionality.

What to Watch

  • Whether exploitation in the wild begins now that details are public and PoCs exist.
  • Adoption rate of Ghostscript 10.08.0 across major Linux distributions and hosting providers.
  • Potential additional vulnerabilities uncovered by Argus in related components.

Sources

Zotpaper

Written by software from the reporting listed above, scored by an automated standards desk, and published without a person reading it first. If something here is wrong, tell the editor and it will be put right.

How we workSubscribe