CVE-2024-46952

7.8 HIGH

📋 TL;DR

This vulnerability in Artifex Ghostscript allows buffer overflow during PDF XRef stream handling, potentially enabling remote code execution. It affects systems processing PDF files with Ghostscript versions before 10.04.0. Organizations using Ghostscript for PDF rendering or conversion are at risk.

💻 Affected Systems

Products:
  • Artifex Ghostscript
Versions: All versions before 10.04.0
Operating Systems: All platforms running Ghostscript
Default Config Vulnerable: ⚠️ Yes
Notes: Any system using Ghostscript to process PDF files is vulnerable regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution with the privileges of the Ghostscript process, potentially leading to full system compromise.

🟠

Likely Case

Application crash (denial of service) or limited memory corruption leading to unstable behavior.

🟢

If Mitigated

Minimal impact if Ghostscript runs in sandboxed environments with limited privileges.

🌐 Internet-Facing: HIGH - Ghostscript often processes user-uploaded PDF files in web applications.
🏢 Internal Only: MEDIUM - Internal document processing systems could be targeted via malicious PDFs.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires crafting a malicious PDF file with specific XRef stream values.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 10.04.0

Vendor Advisory: https://github.com/ArtifexSoftware/ghostpdl/blob/master/doc/News.html

Restart Required: Yes

Instructions:

1. Download Ghostscript 10.04.0 or later from official sources
2. Stop all Ghostscript processes
3. Install the updated version
4. Restart affected services

🔧 Temporary Workarounds

Disable PDF processing

all

Temporarily disable Ghostscript PDF processing until patching

Run with reduced privileges

linux

Run Ghostscript with minimal system privileges to limit impact

sudo -u nobody gs [options]

🧯 If You Can't Patch

  • Implement strict input validation for PDF files before processing
  • Isolate Ghostscript processes in containerized or sandboxed environments

🔍 How to Verify

Check if Vulnerable:

Check Ghostscript version with 'gs --version' and compare to 10.04.0

Check Version:

gs --version

Verify Fix Applied:

Confirm version is 10.04.0 or higher with 'gs --version'

📡 Detection & Monitoring

Log Indicators:

  • Ghostscript crash logs
  • Memory access violation errors
  • Unexpected process termination

Network Indicators:

  • Unusual PDF file uploads to systems using Ghostscript

SIEM Query:

process_name:gs AND (event_type:crash OR exit_code:139)

🔗 References

📤 Share & Export