Critical Ghostscript Heap Buffer Overflow (CVE‑2026‑39919) Enables Remote Code Execution via PDF Uploads
What It Is — A critical heap buffer overflow (CVE‑2026‑39919) has been identified in the Ghostscript interpreter and rendering engine, versions 9.21 through 10.07.1. The flaw is triggered when Ghostscript processes a specially‑crafted PDF that contains a JPEG 2000 image with low‑bit‑depth samples and mismatched component resolutions. Under these conditions Ghostscript writes 1,024 bytes into a 256‑byte buffer, corrupting adjacent memory and allowing unauthenticated remote code execution (RCE).
The vulnerability was discovered on 23 August 2026 by Defiant’s Wordfence platform, which leveraged its Argus AI system to generate two proof‑of‑concept exploits. The researchers demonstrated that, when Ghostscript is invoked by the PHP Imagick extension (commonly used by WordPress to generate PDF thumbnails), the exploit can achieve RCE on a purpose‑built test server. In broader testing across ten Linux distributions—including Debian, Ubuntu, Fedora, Alpine, and AlmaLinux—as well as an official WordPress Docker image, the vulnerable code was present in all cases. However, successful exploitation required environment‑specific tweaks; in a lab testbed the PoC ran 10,240 attempts without achieving RCE, underscoring the exploit’s dependence on configuration details.
Affected Products — Ghostscript 9.21 – 10.07.1 (any platform); WordPress installations that invoke Ghostscript via ImageMagick/Imagick; Docker images that bundle vulnerable Ghostscript versions.
Why It Matters for Trust & Control Assurance — The flaw spotlights the need for rigorous patch management and secure handling of untrusted file inputs, a control area that underpins multiple compliance frameworks.
Recommended Actions
- Verify Ghostscript version; upgrade to 10.08.0 or later, applying back‑ported patches where applicable.
- For Docker deployments, rebuild images with the patched Ghostscript base and redeploy.
- If immediate upgrade is not feasible, block PDF uploads or disable PDF rendering in ImageMagick/Imagick.
- Review application logic to ensure only authenticated, authorized users can upload PDFs, and enforce content‑type validation before processing.
- Capture evidence of the patch status and upload controls for audit readiness.
Source: BleepingComputer – Ghostscript flaw lets hackers hijack servers via PDF uploads