Skip to main content
Mallory
MediumPublic exploitVulnerability

CVE-2024-29510: Ghostscript uniprint Format String Injection and SAFER Sandbox Escape

Published Jul 3, 2024 · Updated today
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days2 mentions · peak 2 in a dayToday
CVSS6.3Medium · v3.1
EPSS27.7%98th percentile
CISA KEVNoNot listed
In the wildReported1 exploitation record in Mallory
Vendors
Artifex SoftwareGhostscript
IdentifiersCVE-2024-29510CWE-134

CVE-2024-29510 is a format string vulnerability in Artifex Ghostscript, documented in versions 9.50 through 10.03.0, that permits memory corruption and escape from the SAFER sandbox. The uniprint output device accepts attacker-controlled formatting parameters, including upYMoveCommand. In upd_wrtrtl(), this parameter is passed as the format string to gs_snprintf() with insufficient variadic arguments, allowing crafted format specifiers to disclose and modify process memory. Exploitation can overwrite the path_control_active field, disable sandbox restrictions, and execute operating-system commands. Malicious PostScript or EPS documents can expose applications that invoke Ghostscript directly or indirectly for document rendering and conversion.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation compromises Ghostscript's sandbox boundary and enables arbitrary command execution with the privileges of the Ghostscript process or invoking application. Memory disclosure can expose environment variables, addresses useful for bypassing ASLR, and stack cookies. Arbitrary memory writes can disable sandbox enforcement, allowing access to files and command-execution facilities otherwise prohibited by SAFER. Network-facing conversion and image-processing services may consequently expose host data and application privileges to remote attackers.

Mitigation

If you can’t patch tonight, do this now.

Until patched, prevent untrusted PostScript and EPS from reaching Ghostscript. Where these formats are unnecessary, enforce an explicit validated input-format or decoder allowlist rather than relying on MIME labels, and remove Ghostscript from processing environments where feasible. Restrict access to exposed conversion or image-processing endpoints. Run rendering workloads with least privilege and external filesystem, process, resource, and network restrictions to reduce consequences of a sandbox escape. SAFER mode alone does not prevent exploitation.

Remediation

Patch, then assume compromise.

Upgrade Ghostscript to version 10.03.1 or later, or install a vendor-maintained package explicitly patched for CVE-2024-29510. Ghostscript 10.03.0 does not fix this vulnerability. Update all affected installations, including copies used indirectly by document converters, image-processing libraries, rendering services, and application containers. For Chainguard packages, install version 10.03.1-r0 or a later fixed package.

Public exploits

Exploits

3 exploits validated by Mallory's analysis.

View more in app →
ghostscript_format_string_cve_2024_29510.rbThis repository contains a single Metasploit module targeting CVE-2024-29510, a format string vulnerability in Ghostscript versions 10.03.0 and 10.01.2. The exploit allows an attacker to bypass the Ghostscript SAFER sandbox and execute arbitrary commands on the target system. The module generates a malicious Encapsulated PostScript (EPS) file, which, when processed by a vulnerable Ghostscript instance (directly or via a library such as ImageMagick), triggers the vulnerability and executes the attacker's payload. The default payload is a Meterpreter reverse shell, but any Metasploit command payload can be used. The module is weaponized, allowing for easy payload customization and integration into attack workflows. The main file is written in Ruby and follows the standard Metasploit module structure, with options for output filename and stack index adjustment. The exploit is file-format based, requiring the attacker to deliver the crafted EPS file to the target for processing.Disclosed Mar 14, 2024 · Framework: metasploit · ruby · fileformatWeaponizedCVE-2024-29510This repository provides a proof-of-concept (POC) exploit for CVE-2024-29510, a format string vulnerability in Ghostscript 10.01.2. The exploit is based on research by Codean Labs and demonstrates both local and remote exploitation scenarios. The repository includes: - PostScript/EPS exploit files (document.eps, vulnapp/bad.eps) that leverage the format string vulnerability to disable Ghostscript's sandbox and execute arbitrary shell commands via the %pipe% operator. - A Bash stager script (run) that automates vulnerability checking and exploitation by downloading and executing the appropriate PostScript files. - Python and HTML files (vulnapp/app.py, vulnapp/templates/index.html) implementing a Flask-based web application (VulnApp) that allows users to upload PS/EPS files for conversion, simulating a remote attack surface. - Reverse shell payloads (index.html, vulnapp/shell.html) written in Python, which are fetched and executed on the victim to provide the attacker with a shell. - A Dockerfile for building a vulnerable environment with Ghostscript 10.02.1 (for demonstration) and the VulnApp web application. The exploit works by uploading a malicious EPS file to a vulnerable Ghostscript instance (locally or via the VulnApp web app). The EPS file manipulates internal Ghostscript structures to disable sandboxing, then uses %pipe% to execute a command that downloads and runs a Python reverse shell, connecting back to the attacker's host on port 443. The repository is well-structured for both local and remote testing, and provides all necessary components for demonstration and exploitation of the vulnerability.swsmith2391 · Disclosed Jul 9, 2024 · python · bash · local · networkOperationalwongpressThis repository is a vulnerable WordPress lab plus exploit material for two RCE chains: CVE-2024-2961 (glibc iconv/CNEXT PHP file-read to RCE) and CVE-2024-29510 (Ghostscript format-string to RCE). It is not just a standalone exploit; most of the repository builds a reproducible Docker environment that intentionally installs vulnerable components and exposes reachable web endpoints. Repository structure: the top level contains deployment/cleanup automation (setup.sh, clean.sh), two Docker Compose definitions for local and production-style labs, nginx configs, and a wordpress/ build context. The wordpress/ directory contains Dockerfiles that pin Ubuntu 22.04 with glibc 2.35, install WordPress, BuddyForms 2.7.6, PHP-FPM, and Ghostscript 10.02.1, plus entrypoint scripts that auto-configure the site. A custom mu-plugin adds an unauthenticated AJAX action convert_ps_to_image that accepts PS/EPS/PDF uploads, stores them under wp-content/uploads, and invokes ghostscript on them. Nginx is configured to expose uploads with autoindex enabled. Main exploit capabilities: the Python file exploit/cve=2024-2961.py is the primary exploit code. It adapts the public CNEXT technique to a WordPress AJAX endpoint by POSTing to /wp-admin/admin-ajax.php with action=upload_image_from_url. It uses a long php://filter iconv/base64 chain to turn a file-read primitive into disclosure of sensitive files such as /proc/self/maps and libc, then performs heap-oriented exploitation to execute an attacker-supplied command. This is a real exploit, not a detector. The included markdown exploit/cve-2024-29510.md is more of an operator note than code; it documents using a Metasploit Ghostscript module to generate a malicious PostScript file and then uploading it to the repository’s custom AJAX endpoint to obtain a reverse Meterpreter shell. Notable targeting details: the lab explicitly references WordPress, BuddyForms 2.7.6, glibc 2.35, and Ghostscript 10.02.1. The Docker setup intentionally enables risky conditions such as allow_url_fopen, PS/EPS/PDF processing, apparmor=unconfined, and extra Linux capabilities. Overall purpose: provide a realistic Ubuntu/WordPress environment for demonstrating how a web-exposed file-read primitive and a Ghostscript file-conversion feature can be chained into remote code execution.whyuhurtz · Disclosed May 29, 2026 · markdown · bash · web · network · fileOperational
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Artifex SoftwareGhostscriptapplication
GhostscriptGhostscriptapplication
FAQ

Frequently asked questions

Is CVE-2024-29510 exploited in the wild?
Yes. As of Dec 2, 2026, Mallory has reports of exploitation in the wild.
Is there a public exploit for CVE-2024-29510?
Yes. Mallory tracks 3 public exploits or proofs of concept for CVE-2024-29510, the earliest disclosed Mar 14, 2024.
Is there a patch for CVE-2024-29510?
Upgrade Ghostscript to version 10.03.1 or later, or install a vendor-maintained package explicitly patched for CVE-2024-29510. Ghostscript 10.03.0 does not fix this vulnerability.
What products are affected by CVE-2024-29510?
Ghostscript and Artifex Software Ghostscript.
How severe is CVE-2024-29510?
CVE-2024-29510 has a CVSS v3.1 score of 6.3 (Medium) and an EPSS score of 27.7% (98th percentile) as of Dec 2, 2026.
Activity feed

Recent activity

15 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
+10 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signatures1YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activityCommunity discussion across Reddit, Mastodon, and other social sources.