CVE-2017-8291
High · 7.8 CISA KEVCVSS
7.8
EPSS
97.0%
Published
Apr 27, 2017
CISA due date
Jun 14, 2022
Cloudanix analysis
A document-handling tool could be tricked into running attacker commands simply by opening a specially crafted image file, giving criminals full control of the affected computer.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Remote Code Execution
- Component
- Application
- Class
- Other
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Type confusion in .rsdparams handling allows -dSAFER sandbox bypass in Ghostscript, enabling arbitrary command execution when an EPS file contains a crafted /OutputFile (%pipe% substring.
Why it matters to the business
Attackers can achieve remote code execution on any system processing untrusted EPS files with vulnerable Ghostscript, resulting in full host compromise. High EPSS and historical KEV listing indicate real-world risk, though the issue is over seven years old and most environments are already updated.
How an attack unfolds
An attacker crafts an EPS document embedding the /OutputFile (%pipe% directive, delivers it to a target (email, web download, or document workflow), and triggers processing by the gs binary or any application linking Ghostscript; the type confusion bypasses the sandbox and spawns attacker-controlled commands. The flaw was exploited in the wild in April 2017.
How to fix it
Upgrade Ghostscript to a build dated after 2017-04-26. The listed py3-pip-wheel packages (Chainguard and Wolfi) are already fixed in version 0; ensure any downstream consumers pull the corrected package and rebuild images.
How to confirm the fix worked
Run gs --version to confirm build date after April 2017; attempt to process a test EPS containing the pipe directive and verify that -dSAFER still blocks execution.
Typical attack path
- Create malicious EPS containing /OutputFile (%pipe% substring
- Deliver file to victim via email attachment or web link
- Victim or automated process opens the file with gs or a Ghostscript-dependent application
- Type confusion triggers sandbox bypass and executes shell commands
- Attacker establishes persistence or exfiltrates data
How to detect it
Search process-creation logs for gs or ghostscript binaries spawning shells or network tools immediately after EPS file access; inspect email gateways and document repositories for files containing the literal string /OutputFile (%pipe%.
- /OutputFile (%pipe%
- gs.*-dSAFER.*.eps
- ghostscript.*pipe
What your security team should do
- Confirm no remaining Ghostscript instances pre-date 2017-04-26 in container or host fleets
- Block or sandbox all EPS/PostScript processing from untrusted sources
- Add the historical KEV due date (2022-06-14) to any legacy-asset review backlog
- Scan build pipelines for direct or transitive Ghostscript dependencies
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Alpine:v3.10 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.11 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.12 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.13 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.14 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.15 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.16 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.17 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.18 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.19 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.2 | ghostscript | 0 | 9.21-r0 |
| Alpine:v3.20 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.21 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.22 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.3 | ghostscript | 0 | 9.21-r0 |
| Alpine:v3.4 | ghostscript | 0 | 9.21-r0 |
| Alpine:v3.5 | ghostscript | 0 | 9.21-r0 |
| Alpine:v3.6 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.7 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.8 | ghostscript | 0 | 9.21-r2 |
| Alpine:v3.9 | ghostscript | 0 | 9.21-r2 |
| Debian:11 | ghostscript | 0 | 9.20~dfsg-3.1 |
| Debian:12 | ghostscript | 0 | 9.20~dfsg-3.1 |
| Debian:13 | ghostscript | 0 | 9.20~dfsg-3.1 |
| Debian:7 | ghostscript | 0 | 9.05~dfsg-6.3+deb7u6 |
| Debian:8 | ghostscript | 0 | 9.06~dfsg-2+deb8u5 |
| Mageia:5 | ghostscript | 0 | 9.20-1.mga5 |
| Mageia:5 | gutenprint | 0 | 5.2.10-5.1.mga5 |
| Mageia:5 | libspectre | 0 | 0.2.7-5.1.mga5 |
| Red Hat:enterprise_linux:6::client | ghostscript | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::client | ghostscript-debuginfo | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::client | ghostscript-devel | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::client | ghostscript-doc | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::client | ghostscript-gtk | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::computenode | ghostscript | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::computenode | ghostscript-debuginfo | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::computenode | ghostscript-devel | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::computenode | ghostscript-doc | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::computenode | ghostscript-gtk | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::server | ghostscript | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::server | ghostscript-debuginfo | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::server | ghostscript-devel | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::server | ghostscript-doc | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::server | ghostscript-gtk | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::workstation | ghostscript | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::workstation | ghostscript-debuginfo | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::workstation | ghostscript-devel | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::workstation | ghostscript-doc | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:6::workstation | ghostscript-gtk | 0 | 0:8.70-23.el6_9.2 |
| Red Hat:enterprise_linux:7::client | ghostscript | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::client | ghostscript-cups | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::client | ghostscript-debuginfo | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::client | ghostscript-devel | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::client | ghostscript-doc | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::client | ghostscript-gtk | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::computenode | ghostscript | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::computenode | ghostscript-cups | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::computenode | ghostscript-debuginfo | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::computenode | ghostscript-devel | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::computenode | ghostscript-doc | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::computenode | ghostscript-gtk | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::server | ghostscript | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::server | ghostscript-cups | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::server | ghostscript-debuginfo | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::server | ghostscript-devel | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::server | ghostscript-doc | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::server | ghostscript-gtk | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::workstation | ghostscript | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::workstation | ghostscript-cups | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::workstation | ghostscript-debuginfo | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::workstation | ghostscript-devel | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::workstation | ghostscript-doc | 0 | 0:9.07-20.el7_3.5 |
| Red Hat:enterprise_linux:7::workstation | ghostscript-gtk | 0 | 0:9.07-20.el7_3.5 |
| SUSE:Linux Enterprise Desktop 12 SP1 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Desktop 12 SP1 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Desktop 12 SP2 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Desktop 12 SP2 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Point of Sale 11 SP3 | ghostscript-library | 0 | 8.62-32.46.1 |
| SUSE:Linux Enterprise Server 11 SP3-LTSS | ghostscript-library | 0 | 8.62-32.46.1 |
| SUSE:Linux Enterprise Server 11 SP3-TERADATA | ghostscript-library | 0 | 8.62-32.46.1 |
| SUSE:Linux Enterprise Server 11 SP4 | ghostscript-library | 0 | 8.62-32.44.1 |
| SUSE:Linux Enterprise Server 11 SP4 | ghostscript-library | 0 | 8.62-32.46.1 |
| SUSE:Linux Enterprise Server 12 SP1 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Server 12 SP1 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server 12 SP2 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Server 12 SP2 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server 12-LTSS | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | ghostscript-library | 0 | 8.62-32.44.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | ghostscript-library | 0 | 8.62-32.46.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | ghostscript-library | 0 | 8.62-32.44.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | ghostscript-library | 0 | 8.62-32.46.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP1 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP1 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP2 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP2 | ghostscript | 0 | 9.15-22.1 |
| SUSE:OpenStack Cloud 5 | ghostscript-library | 0 | 8.62-32.46.1 |
| Ubuntu:14.04:LTS | ghostscript | 0 | 9.10~dfsg-0ubuntu10.7 |
| Ubuntu:16.04:LTS | ghostscript | 0 | 9.18~dfsg~0-0ubuntu2.4 |
| openSUSE:Tumbleweed | ghostscript | 0 | 9.54.0-2.2 |
Related vulnerabilities
- CVE-2023-36664 Artifex Ghostscript before 10.01.2 mishandles permission validation for pipe devices… Also affects ghostscript
- CVE-2025-27835 An issue was discovered in Artifex Ghostscript before 10.05.0. Also affects ghostscript
- CVE-2025-27836 An issue was discovered in Artifex Ghostscript before 10.05.0. Also affects ghostscript
- CVE-2025-27837 An issue was discovered in Artifex Ghostscript before 10.05.0. Also affects ghostscript
- CVE-2025-27832 An issue was discovered in Artifex Ghostscript before 10.05.0. Also affects ghostscript
- CVE-2024-46956 An issue was discovered in psi/zfile.c in Artifex Ghostscript before 10.04.0. Also affects ghostscript
- CVE-2024-46955 An issue was discovered in psi/zcolor.c in Artifex Ghostscript before 10.04.0. Also affects ghostscript
- CVE-2024-46953 An issue was discovered in base/gsdevice.c in Artifex Ghostscript before 10.04.0. Also affects ghostscript