CVE DatabaseCVE-2017-8291
한국어 권고문 →
CVE-2017-82917.8/HIGHCISA KEVCWE-843CWE-843

Artifex Ghostscript Type Confusion -dSAFER Bypass and Remote Code Execution Vulnerability (CVE-2017-8291)

⚡ Jump to Patch
Affected Vendors
artifex
Affected Components
ghostscript
Published Date
2017-04-27
CVSS v3.1
7.8
HIGH
EPSS (30d)
97.0%
FIRST.org
CISA KEV
Exploited

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

Artifex Ghostscript versions released through 2017-04-26, and image processing libraries (e.g., ImageMagick) relying on it

Impact

Remote attackers can bypass the '-dSAFER' sandbox restriction and execute arbitrary system commands via a crafted EPS document

Mitigation

Immediately upgrade Ghostscript to the patched version or disable PostScript/EPS processing in application policies

Affected Products & Version Scope

All Artifex Ghostscript versions released on or before April 26, 2017 (including version 9.21 and prior)

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. Official Patch & Version Upgrade Commands

Update Ghostscript to the latest patched version using your operating system's package manager.

bash
# For Debian/Ubuntu-based systems
sudo apt-get update && sudo apt-get install --only-upgrade -y ghostscript

# For RedHat/CentOS-based systems
sudo yum update -y ghostscript

2. Temporary Workaround & Hardening Configuration

If patching is not immediately possible, disable Ghostscript rendering for vulnerable formats in ImageMagick's policy.xml file.

bash
# Open the ImageMagick policy configuration file
sudo nano /etc/ImageMagick-6/policy.xml

# Add the following lines inside the <policymap> block to disable vulnerable coders
# <policy domain='coder' rights='none' pattern='EPS' />
# <policy domain='coder' rights='none' pattern='PS' />
# <policy domain='coder' rights='none' pattern='PDF' />
# <policy domain='coder' rights='none' pattern='XPS' />

3. Log Audit & IoC Verification Commands

Verify the installed Ghostscript version and scan system logs and upload directories for potential exploitation attempts.

bash
# Check the current Ghostscript version
gs --version

# Scan web server logs and temporary directories for '%pipe%' and '.rsdparams' patterns
grep -rni '%%pipe%%' /var/log/nginx/ /var/log/apache2/ /tmp/ 2>/dev/null
find /var/www/ -type f -name '*.eps' -exec grep -qi 'rsdparams' {} \; -print
Interactive SecOps Remediation Checklist
0/4 (0%)
Recommended Security Control & Mitigation Partner
SentinelOne Singularity AI EDR
Apply the latest Ghostscript security updates immediately and restrict PostScript file processing in web applications.

Block Kernel Privilege Escalation & Ransomware Payloads Before You Can Reboot

Protect unpatched Windows, Linux, and macOS workloads against in-memory exploitation and lateral movement with autonomous EDR.

100% MITRE ATT&CK Detection · 1-Click Rollback

Technical Root Cause & Exploitation Mechanics

1. Vulnerability Overview & Root Cause

This vulnerability (CVE-2017-8291) is a critical type confusion vulnerability (CWE-843) in Artifex Ghostscript, a widely used PostScript and PDF interpreter. Ghostscript utilizes the '-dSAFER' parameter to restrict file system access and command execution. However, a flaw in how the interpreter handles the '.rsdparams' (ReusableStreamDecode parameters) object allows an attacker to confuse the data types of internal structures. This memory corruption bypasses the sandbox restrictions, enabling unauthorized system-level operations.

2. Exploitation Mechanics & Attack Scenario

An attacker exploits this vulnerability by crafting an Encapsulated PostScript (.eps) file containing a malicious payload with a '/OutputFile (%pipe%...' substring. When Ghostscript processes this file, the type confusion in '.rsdparams' disables the '-dSAFER' protection. The interpreter then processes the output stream using the '%pipe%' syntax, which redirects the output to the operating system shell, executing the embedded commands. This is highly critical for web applications that automatically process user-uploaded images using backend tools like ImageMagick.

3. Infrastructure & Business Impact

As a CISA KEV-listed vulnerability with an EPSS score of 0.9697, this flaw has been actively exploited in the wild. Successful exploitation grants the attacker arbitrary code execution under the privileges of the web server or application process. This can lead to full system compromise, lateral movement within the internal network, data exfiltration, and deployment of ransomware, posing severe operational and financial risks.

Official Vendor Advisories & References

Frequently Asked SecOps Questions (CVE-2017-8291)

FAQ

Q1. How critical is CVE-2017-8291 and is it actively exploited in the wild?

CVE-2017-8291 is rated CVSS 7.8 (HIGH) with a 30-day EPSS exploitation probability of 97.0%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.

Q2. Which vendors and products are affected by CVE-2017-8291?

Primary impacted vendors include artifex across ghostscript. Scope summary: All Artifex Ghostscript versions released on or before April 26, 2017 (including version 9.21 and prior)

Q3. What temporary mitigations or workarounds exist for CVE-2017-8291 before patching?

[Mitigation] Immediately upgrade Ghostscript to the patched version or disable PostScript/EPS processing in application policies Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.

SECOPS WORKBENCH INTEGRATION

Generate an Internal Engineering Notice or CISO Report for CVE-2017-8291

Instantly format this advisory into an executive CISO summary or engineering patch ticket.

Generate Report →

🔗 Related Advisories in Similar Stack (artifex)

View Category →
SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed:
PatchKO
CVE-2017-8291 Artifex Ghostscript Type Confusion -dSAFER Bypass and Remote Code Execution Vulnerability (CVE-2017-8291) (CVSS 7.8) - Patch & Workaround | CVE Pulse