CVE-2017-8291 is a remote command execution vulnerability in Artifex Ghostscript affecting versions through 2017-04-26. The flaw is a type confusion issue involving .rsdparams handling that can be used to bypass the Ghostscript -dSAFER sandbox. By supplying a crafted EPS document containing a pipe-based output directive, an attacker can cause Ghostscript to execute arbitrary commands despite the intended safety restrictions. The vulnerability is especially relevant in applications that automatically invoke Ghostscript to process embedded EPS content, including document workflows where opening a document triggers EPS rendering.
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
If you can’t patch tonight, do this now.
Patch, then assume compromise.
5 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos.
This repository provides a proof-of-concept (POC) exploit for the GhostButt vulnerability (CVE-2017-8291) affecting Python's PIL/Pillow library when used with GhostScript. The repository contains a simple Flask web application (app.py) that allows users to upload PNG files, which are then processed using PIL. The vulnerability arises because PIL determines file type based on file headers, not extensions, and passes EPS files to GhostScript for processing. The included poc.png is actually a malicious EPS file disguised as a PNG, containing PostScript code that exploits the GhostScript sandbox bypass to execute arbitrary commands on the server (demonstrated by creating /tmp/aaaaa). The Dockerfile and docker-compose.yml facilitate easy setup of the vulnerable environment. The README files provide detailed background, exploitation steps, and references. The main attack vector is via network (HTTP file upload), and the exploit demonstrates arbitrary command execution on the server. The repository is a clear, functional POC for CVE-2017-8291, targeting Python web applications using PIL/Pillow and GhostScript.
This repository demonstrates a remote command execution exploit targeting Python web applications that use the PIL/Pillow library with Ghostscript for image processing. The main application (app.py) is a Flask web server that allows users to upload images, which are then processed using PIL. If a user uploads a specially crafted EPS file (disguised as a PNG), Ghostscript is invoked by PIL to process the file. Due to vulnerabilities in Ghostscript (CVE-2017-8291 and CVE-2018-16509), the '-dSAFER' sandbox can be bypassed, allowing arbitrary shell commands to be executed on the server. The repository includes proof-of-concept EPS files (poc.png, poc_ctf.png) that demonstrate file creation and reverse shell payloads. The attack vector is network-based, exploiting the web upload endpoint at http://localhost:8000. The exploit is operational, providing real command execution on vulnerable systems. The repository is structured with a main Python application, documentation, Docker configuration for easy setup, and example payloads.
This repository demonstrates a proof-of-concept exploit for CVE-2017-8291, a remote command execution vulnerability affecting Python's PIL/Pillow library when used in conjunction with a vulnerable version of GhostScript (<=9.21). The repository contains a simple Flask web application (app.py) that allows users to upload PNG images, which are then processed using PIL. Due to the way PIL determines image type by file header, an attacker can upload a malicious EPS file disguised as a PNG. When processed, GhostScript executes embedded PostScript code, bypassing the '-dSAFER' sandbox and allowing arbitrary command execution. The provided POC (poc.png) creates a file '/tmp/aaaaa' on the server, but this can be modified to execute any command, including spawning a reverse shell. The repository includes setup instructions using Docker, a detailed README in both English and Chinese, and a sample exploit file. The main attack vector is via the web application's file upload endpoint, and exploitation requires the backend to process user-supplied images with PIL and GhostScript.
This repository demonstrates a proof-of-concept (POC) exploit for CVE-2017-8291, a remote code execution vulnerability in the Python Imaging Library (PIL) when used with GhostScript. The exploit leverages the fact that PIL determines image type based on file headers, not extensions, allowing an attacker to upload a malicious EPS file disguised as a PNG. When the server processes this file (using GhostScript), arbitrary shell commands embedded in the EPS are executed. The repository includes a Flask web application (app.py) that accepts PNG uploads, a docker-compose.yml for environment setup, and a crafted poc.png file that, when uploaded, causes the server to create a file at /tmp/aaaaa, demonstrating code execution. The README provides detailed setup and exploitation instructions. The main attack vector is via HTTP file upload to the web interface at http://localhost:8000/. The exploit is a POC but can be weaponized by modifying the payload to execute more impactful commands, such as spawning a reverse shell.
This repository contains a single Metasploit module targeting a type confusion vulnerability in Ghostscript (CVE-2017-8291). The exploit is weaponized and generates a malicious EPS file (default: msf.eps) that, when processed by a vulnerable Ghostscript instance (version 9.21 or earlier), results in arbitrary command execution. The vulnerability can be triggered directly or via libraries such as ImageMagick or Pillow, making it relevant for server-side image processing scenarios. The module allows the user to specify a payload command, which is embedded into the EPS template. The structure is typical for a Metasploit file format exploit, with the main logic in the 'exploit' method, which creates the malicious file. The only endpoints present are the generated EPS file and an example output file path (/dev/null) used in demonstration commands.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
10 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
A specific vulnerability identified as CVE-2017-8291 is referenced in connection with analysis of Xctdoor and past CRAT attack cases attributed to Larva-26005.
A specific vulnerability identified as CVE-2017-8291 is referenced in connection with an AhnLab post about Xctdoor and past CRAT attack cases, but no technical details about the flaw are provided in the content.
A vulnerability identified as CVE-2017-8291 used in malicious Hangul Word Processor documents to distribute the CRAT malware via spear-phishing.
A specific vulnerability used in 2020 spear-phishing delivery of CRAT via a Hangul document targeting Korean users.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.