Skip to content
RCE Write-up Intermediate

Proof of Concept Developed for Ghostscript CVE-2023-36664 Code Execution Vulnerability

Ghostscript mishandled permission validation for pipe devices, allowing a crafted document to execute arbitrary commands when opened. An attacker could achieve code execution by convincing a victim to open a malicious EPS or PDF file.

Dave Truman Follow

Published on kroll.com

https://www.linkedin.com/sharing/share-offsite/url=mailto:?subject=Proof%20of%20Concept%20Developed%20for%20Ghostscript%20CVE-2023-36664%20Code%20Execution%20Vulnerability&body=

Dave Truman, on kroll.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the path validation function was called after a path reduction step that could be tricked by a specially crafted path starting with a pipe prefix, bypassing permission checks.

Impact

An attacker could execute arbitrary commands on the victim's system by getting them to open a malicious file, potentially affecting many applications that use Ghostscript.

What the attacker needed

Victim opens a malicious file; Ghostscript is used by the application

The fix

The vulnerability was fixed in Ghostscript version 10.01.2 by adding a check to prevent the path reduction function from running on paths starting with the pipe prefix.

How it was found

  1. Craft an EPS file that uses a pipe device path.
  2. Open the file in Ghostscript directly or via an application that uses Ghostscript.
  3. Observe that arbitrary commands are executed.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Ghostscript is a program that reads PDF and PostScript files, often used behind the scenes by other apps. A bug let a malicious file trick Ghostscript into running commands on the computer, so opening a bad file could let an attacker take control.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More from Artifex Ghostscript

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.