Critical Ghostscript heap overflow can reach RCE through WordPress PDF previews (CVE-2026-39919)
Wordfence’s Argus team has disclosed CVE-2026-39919, a critical heap buffer overflow in Ghostscript (CVSS 9.8). Ghostscript is the document engine many servers use to render PDF previews, and a crafted PDF containing a JPEG 2000 image can make it write attacker-influenced bytes past the end of a memory buffer. Wordfence developed that corruption into unauthenticated remote code execution on a purpose-built WordPress test site.
This is not a WordPress bug, so there is no plugin to update. The attack path runs WordPress to Imagick to ImageMagick to Ghostscript whenever a preview or thumbnail is generated from an uploaded PDF. Since WordPress 4.7, core can generate a preview image of a PDF’s first page on servers using the PHP Imagick extension. Ghostscript versions 9.21 through 10.07.1 are affected, and Wordfence found the official WordPress Docker image snapshot vulnerable in its September 15 tests. The team says it has found no public evidence of in-the-wild exploitation so far, but notes the difficulty of exploiting a heap overflow is not a defense.
You should assume you are affected if visitors or low-privilege users can upload PDFs to your site and something on the site generates a preview or thumbnail from them. If uploaded PDFs are only stored and never processed, this path is not exposed, but many site owners will not know what happens behind the scenes. The fix shipped in Ghostscript 10.08.0 on September 8, 2026, and Linux distributions have been backporting it since.
What to do
- Install the fixed Ghostscript package from your OS or hosting provider. Check the full package revision with dpkg -s ghostscript or rpm -q ghostscript, not just gs –version, because many distros backport the fix into older version numbers.
- For containerized sites, rebuild and redeploy from an updated base image rather than restarting the old container.
- If you cannot patch immediately, stop accepting PDFs from visitors and low-privilege users, or disable PDF reads in ImageMagick’s security policy (this also disables PDF previews).
- Ask your host whether uploaded PDFs reach Ghostscript, and confirm the fix is installed before reopening PDF uploads.
This is the server layer that site owners rarely see, and it is the first layer ZeroBreach audits. Its recurring scans inventory the whole stack, server first, and flag unpatched system components like Ghostscript before a crafted file ever arrives.