CVE-2019-14813

9.8 CRITICAL

📋 TL;DR

This vulnerability in Ghostscript versions 9.x before 9.50 allows specially crafted PostScript files to bypass the -dSAFER security sandbox. Attackers can gain file system access or execute arbitrary commands. Any system processing untrusted PostScript files with vulnerable Ghostscript is affected.

💻 Affected Systems

Products:
  • Ghostscript
  • Applications using Ghostscript libraries (ImageMagick, LibreOffice, etc.)
Versions: 9.x versions before 9.50
Operating Systems: Linux, Windows, macOS, Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using Ghostscript to render PostScript/PDF files is vulnerable when processing untrusted input.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or ransomware deployment.

🟠

Likely Case

File system access allowing data exfiltration or privilege escalation.

🟢

If Mitigated

Limited impact if proper input validation and sandboxing are enforced.

🌐 Internet-Facing: HIGH - Web applications processing user-uploaded PostScript files are directly exposed.
🏢 Internal Only: MEDIUM - Internal systems processing documents from untrusted sources remain vulnerable.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires delivering a malicious PostScript file to a vulnerable system.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 9.50 or later

Vendor Advisory: https://access.redhat.com/errata/RHSA-2019:2594

Restart Required: No

Instructions:

1. Update Ghostscript to version 9.50 or later using your package manager.
2. For Linux: 'sudo apt update && sudo apt upgrade ghostscript' (Debian/Ubuntu) or 'sudo yum update ghostscript' (RHEL/CentOS).
3. Verify the update with 'gs --version'.
4. Update any applications that bundle Ghostscript libraries.

🔧 Temporary Workarounds

Disable PostScript processing

all

Configure applications to disable Ghostscript processing of PostScript files.

For ImageMagick: edit policy.xml to remove PS, EPS, PDF delegates

Use -dSAFER with additional restrictions

all

Apply stricter sandboxing where possible, though this vulnerability bypasses -dSAFER.

gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=... input.ps

🧯 If You Can't Patch

  • Isolate systems processing untrusted documents in a restricted network segment.
  • Implement strict file upload validation to block PostScript files or sanitize inputs.

🔍 How to Verify

Check if Vulnerable:

Run 'gs --version' and check if version is below 9.50.

Check Version:

gs --version

Verify Fix Applied:

Confirm 'gs --version' returns 9.50 or higher.

📡 Detection & Monitoring

Log Indicators:

  • Unusual Ghostscript process execution patterns
  • Errors from PostScript file processing

Network Indicators:

  • Unexpected outbound connections from document processing servers

SIEM Query:

process_name:"gs" AND (command_line:"-dSAFER" OR command_line:"PostScript")

🔗 References

📤 Share & Export