Artifex Ghostscript Type Confusion Vulnerability (CVE-2017-8291)
Published In CISA KEV since Sources: CVE.org
What is affected, what to do
Artifex Ghostscript through 2017-04-26 allows -dSAFER bypass and remote command execution via .rsdparams type confusion with a "/OutputFile (%pipe%" substring in a crafted .eps document that is an input to the gs program, as exploited in the wild in April 2017.
The vulnerability is being actively exploited; treat it as a priority. Update Artifex Ghostscript to version 9.21. Immediate actions, mitigation and detection rules are in the runbook below.
- Affected
- Artifex Ghostscript
lt *..9.21 - Debian Linux
eq 8.0..8.0 - Redhat Enterprise Linux Desktop
eq 6.0..6.0 - Redhat Enterprise Linux Desktop
eq 7.0..7.0 - Red Hat Enterprise Linux Extended Update Support (EUS)
eq 7.3..7.3 - Red Hat Enterprise Linux Extended Update Support (EUS)
eq 7.4..7.4 - Red Hat Enterprise Linux Extended Update Support (EUS)
eq 7.5..7.5 - Red Hat Enterprise Linux Extended Update Support (EUS)
eq 7.6..7.6 - Red Hat Enterprise Linux Extended Update Support (EUS)
eq 7.7..7.7 - Redhat Enterprise Linux Server
eq 6.0..6.0 - Redhat Enterprise Linux Server
eq 7.0..7.0 - Redhat Enterprise Linux Server Advanced mission critical Update Support (AUS)
eq 7.3..7.3 - Redhat Enterprise Linux Server Advanced mission critical Update Support (AUS)
eq 7.4..7.4 - Redhat Enterprise Linux Server Advanced mission critical Update Support (AUS)
eq 7.6..7.6 - Redhat Enterprise Linux Server Advanced mission critical Update Support (AUS)
eq 7.7..7.7 - Red Hat Enterprise Linux Server (TUS)
eq 7.3..7.3 - Red Hat Enterprise Linux Server (TUS)
eq 7.6..7.6 - Red Hat Enterprise Linux Server (TUS)
eq 7.7..7.7 - Redhat Enterprise Linux Workstation
eq 6.0..6.0 - Redhat Enterprise Linux Workstation
eq 7.0..7.0
- Artifex Ghostscript
- Fixed in
- Artifex Ghostscript
9.21
- Artifex Ghostscript
Not sure whether and how you are affected? Ask a question about this vulnerability
Metrics
7.8
Priority
XIEM Effective CVSS: highest available CVSS rating from NVD and vendor data.
Source: NVD, CVSS v3
7.8
CVSS v3
Severity High on the scale from 0 to 10.
Source: CVE.org
97.0 %
EPSS score
High — model estimates ≥ 50% chance of real-world exploitation within 30 days.
Source: FIRST EPSS, percentile 99.89
Show all metrics
- Severity
- Critical
Priority (0–325)
The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?
Read in glossary- 218.82 Methodology
Exploit maturity
An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.
Read in glossary- actively exploited
XIEM Effective CVSS
XIEM® is the tiered managed-security operating model from NEOSEC and a registered trademark of NEOSEC GmbH. It extends classic SIEM — the central collection, normalisation and correlation of security-relevant events — with endpoint forensics, network visibility and deception technology, and consolidates them into three building tiers: Sentry, Orchestrate and Command.
Read in glossary- 7.8 Methodology
CVSS v3
CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.
Read in glossary- 7.8
EPSS score
The EPSS score is the absolute model output for an individual vulnerability: the estimated probability of real-world exploitation within the next 30 days, expressed as a value between 0 and 1 (i.e. 0 % to 100 %). A score of 0.42 means „the model estimates a 42 % chance of real-world exploitation within 30 days“.
Read in glossary- 97.0 %
- High — model estimates ≥ 50% chance of real-world exploitation within 30 days.
EPSS percentile
The EPSS percentile is the relative position of a vulnerability within all EPSS-scored CVEs, expressed as a value between 0 and 1. A percentile of 0.90 means „this CVE has a higher EPSS score than 90 % of all other scored CVEs“. Unlike the EPSS score, it is not a probability — but a positioning within a ranking.
Read in glossary- 99.89
- Critical — this CVE ranks in the top fifth of all CVEs scored today (rank ≥ 80%).
KEV status
The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.
Read in glossary- Actively exploited
- Published
In CISA KEV since
The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.
Read in glossary- CISA assessment (SSVC)
- Exploitation: active · not automatable · Technical impact: total
- Source: CISA Vulnrichment, as of 4 February 2025
CWE
CWE is a catalogue of typical weakness types in software and hardware — such as flawed input validation, unsafe memory handling or poor authentication. Where a CVE names a concrete vulnerability in a concrete product, a CWE describes the underlying class of defect.
Read in glossary- CWE-843
Response and mitigation
Why act now?
Prioritisation rationale
A crafted EPS file bypasses SAFER mode and yields command execution as the calling process; while the CVSS vector formally reads "local, user interaction required", Ghostscript is routinely invoked server-side and unattended through ImageMagick, upload features and mail processing, which in practice makes this remotely exploitable without authentication. Exploitation likelihood is very high — it sits among the CVEs most likely to be exploited, and public exploits have circulated since 2017. CISA does not flag known ransomware use, but typical targets are web applications with image or document upload and outdated Linux appliances. Treat it as critical wherever upload or conversion functionality is externally reachable; desktop-only installs that never auto-process untrusted files can follow the regular patch cycle.
Runbook step 1
Immediate response (0-24 h)
- Inventory every Ghostscript instance: run
gs --version,rpm -q ghostscriptordpkg -l ghostscriptacross Linux estates. Don't forget indirect callers: ImageMagick/GraphicsMagick delegates, upload thumbnailers, mail gateways, document converters (CUPS filters, CMS and wiki platforms) and desktop thumbnailers. Ghostscript builds up to and including 2017-04-26 (9.21 and earlier) are affected. - Apply distribution security updates: Debian 8 and RHEL 6/7 (including EUS 7.3–7.6) ship fixed
ghostscriptpackages for CVE-2017-8291. Patch available from the vendor — look up the exact package version in the relevant Debian DSA or Red Hat RHSA. For source builds, move to a current supported Artifex release. Restart dependent services (web workers, queue consumers) afterwards. - Prioritise internet-facing processing paths: patch systems that render user uploads (images, PDF, EPS/PS) server-side first. Until patched, disable PostScript/EPS handling there via the ImageMagick
policy.xmlchange below. - Compromise assessment on conversion hosts: check process history, EDR and auditd for
gsever spawning a shell. If found, isolate the host and rotate the service account's secrets (DB credentials, API keys, cloud tokens in environment variables). - Do not rely on
-dSAFER: this bug is precisely a SAFER bypass; the flag alone offers no protection.
- Inventory every Ghostscript instance: run
Runbook step 2
Mitigation layers
- Configuration (ImageMagick): in
/etc/ImageMagick-6/policy.xml(or-7) block Ghostscript-backed coders:<policy domain="coder" rights="none" pattern="{PS,PS2,PS3,EPS,EPI,EPSF,EPSI,EPT,PDF,XPS}" />. Verify withconvert -list policy. - Input validation: validate uploads by magic bytes, not extension. Reject files beginning with
%!PSor the binary EPS headerC5 D0 D3 C6on image endpoints — exploit files are routinely disguised as.jpg/.png. - Endpoint hardening / sandboxing: run Ghostscript inside isolated containers or under an AppArmor/SELinux profile denying
execveof/bin/shand network access. Alternatively wrap it with seccomp/bwrap --unshare-net, a read-only filesystem and a dedicated unprivileged user. - Network segmentation: place rendering workers in a dedicated segment with default-deny egress, cutting off payload downloads and reverse shells.
- IAM / least privilege: rendering service accounts get no sudo, no write access to the webroot and no access to secrets. Treat mail gateways and document management systems as high exposure, since they process untrusted attachments automatically.
- Configuration (ImageMagick): in
Runbook step 3
Detection rules
- auditd (Linux):
-a always,exit -F arch=b64 -S execve -F exe=/usr/bin/gs -k gs_child_exec— any hit wheregslaunches a child process is highly suspicious; Ghostscript has no legitimate need for a shell. - EDR / Sysmon for Linux (EID 1), Sigma shape:
ParentImage|endswith: ['/gs','/gsc'] AND Image|endswith: ['/sh','/bash','/dash','/curl','/wget','/python','/perl','/nc']. KQL (Defender for Endpoint):DeviceProcessEvents | where InitiatingProcessFileName in~ ("gs","gsc") and FileName in~ ("sh","bash","dash","curl","wget","python","perl","nc"). - File content / YARA: scan upload directories, mail quarantine and temp paths for documents containing
.rsdparams,/OutputFileand%pipe%. All three together are a strong exploit indicator. - Web server logs: POST requests to upload/avatar/import endpoints followed closely by unusual processes or new files in the webroot; correlate upload timestamps with
gsprocess starts. - Network telemetry (Zeek/Suricata): outbound connections from rendering workers to previously unseen destinations, especially right after file processing (
conn.logfiltered on the worker segment's source IPs).
- auditd (Linux):
Detection rules
No NEOSEC detection rule is available for this vulnerability yet.
Classification under NIS2 and CRA
Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.
NIS2
NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.
Read in glossary- Actively exploited: treat the vulnerability as a priority in vulnerability handling under Art. 21(2)(e) NIS2. If it is exploited in your environment, check the reporting obligation under Art. 23 (early warning within 24 hours).
CRA
The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.
Read in glossary- Since 11.09.2026, manufacturers of affected products with digital elements must report actively exploited vulnerabilities under Art. 14 CRA, with an early warning within 24 hours via ENISA's single reporting platform.
ISO/IEC 27001
ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.
Read in glossary- Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.
Description
Artifex Ghostscript through 2017-04-26 allows -dSAFER bypass and remote command execution via .rsdparams type confusion with a "/OutputFile (%pipe%" substring in a crafted .eps document that is an input to the gs program, as exploited in the wild in April 2017.
Source: NVD (NIST), cvelistv5, CISA KEV Catalog, CVE.org (MITRE)
Affected products
The following versions are affected. Older releases of the same product line are also vulnerable unless stated otherwise.
| Affected versions | Fixed in | ||
|---|---|---|---|
| artifex | ghostscript |
|
|
Vendors and products
- Artifex Artifex Ghostscript
- Debian Debian Linux
- Red Hat Redhat Enterprise Linux Desktop
- Red Hat Red Hat Enterprise Linux Extended Update Support (EUS)
- Red Hat Redhat Enterprise Linux Server
- Red Hat Redhat Enterprise Linux Server Advanced mission critical Update Support (AUS)
- Red Hat Red Hat Enterprise Linux Server (TUS)
- Red Hat Red Hat Enterprise Linux Workstation
Affected operating systems
| Linux | debian | debian_linux | 8.0 |
| Linux | redhat | enterprise_linux_desktop | 6.0 |
| Linux | redhat | enterprise_linux_desktop | 7.0 |
| Linux | redhat | enterprise_linux_eus | 7.3 |
| Linux | redhat | enterprise_linux_eus | 7.4 |
| Linux | redhat | enterprise_linux_eus | 7.5 |
| Linux | redhat | enterprise_linux_eus | 7.6 |
| Linux | redhat | enterprise_linux_eus | 7.7 |
| Linux | redhat | enterprise_linux_server | 6.0 |
| Linux | redhat | enterprise_linux_server | 7.0 |
| Linux | redhat | enterprise_linux_server_aus | 7.3 |
| Linux | redhat | enterprise_linux_server_aus | 7.4 |
| Linux | redhat | enterprise_linux_server_aus | 7.6 |
| Linux | redhat | enterprise_linux_server_aus | 7.7 |
| Linux | redhat | enterprise_linux_server_tus | 7.3 |
| Linux | redhat | enterprise_linux_server_tus | 7.6 |
| Linux | redhat | enterprise_linux_server_tus | 7.7 |
| Linux | redhat | enterprise_linux_workstation | 6.0 |
| Linux | redhat | enterprise_linux_workstation | 7.0 |
Weakness classes (CWE)
CWE-843Access of Resource Using Incompatible Type ('Type Confusion')
Base
The product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.
Entry at MITRE CWE-843
Public exploit references
Publicly reported proof-of-concepts, exploit modules and detection templates for this vulnerability. NEOSEC links to the original sources only and does not provide any exploit code.
| CISA KEV Catalog | CISA Known Exploited Vulnerability (opens in a new tab)cisa.gov | actively exploited | |
| Reference tagged as exploit | bugzilla.suse.com (opens in a new tab) | PoC (publicly reported)reported, not verified | — |
| Exploit-DB | EDB-ID 41955 (opens in a new tab)exploit-db.com | PoC (publicly reported)reported, not verified | — |
References & sources
- debian.orgDSA-3838Vendor advisory, x_refsource_DEBIAN, Mailing list, Third-party advisory
- bugzilla.suse.comshow_bug.cgi?id=1036453x_refsource_MISC, Exploit, Issue tracking, Third-party advisory, Vulnerability database
- access.redhat.comRHSA-2017:1230Vendor advisory, x_refsource_REDHAT, Third-party advisory
- securityfocus.com98476Vulnerability database, x_refsource_BID, Broken link, Third-party advisory, Vulnerability database
- exploit-db.com41955Exploit, x_refsource_EXPLOIT-DB, Exploit, Third-party advisory, Vulnerability database
- openwall.comlists/oss-security/2017/04/28/2x_refsource_MISC, Mailing list, Patch, Third-party advisory
- security.gentoo.orgGLSA-201708-06Vendor advisory, x_refsource_GENTOO, Third-party advisory
- bugzilla.redhat.comshow_bug.cgi?id=1446063x_refsource_MISC, Issue tracking, Patch, Third-party advisory, Vulnerability database
- git.ghostscript.com?p=ghostpdl.git;a=commit;h=04b37bbce174eed24edec7ad5b920eb93db4…x_refsource_CONFIRM, Broken link
- bugs.ghostscript.comshow_bug.cgi?id=697808x_refsource_MISC, Issue tracking, Third-party advisory, Vulnerability database
- cisa.govknown-exploited-vulnerabilities-catalog?field_cve=CVE-2017-8291government-resource, US government resource
Embed badge
Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.
<a href="https://intel.neosec.eu/en/cve/CVE-2017-8291"><img src="https://intel.neosec.eu/badge/cve/CVE-2017-8291.svg?lang=en" alt="CVE-2017-8291 – NEOSEC Intel" height="20"></a>