字号·· | 护眼
漏洞档案 · 高危

Artifex Ghostscript 类型混淆(CVE-2017-8291)

CVE-2017-8291 别名:GHSA-RH88-CWV2-GJXM、DEBIAN-CVE-2017-8291
CVSS 7.8 / 3.1 EPSS 97.0% CISA KEV 在野利用 公开 PoC · 3
综合风险83/ 100
CVSS7.8高危
EPSS97.0%30 天利用概率
机构收录时间2017-04-27更新 2026-12-03

研判简报

概述

Artifex Ghostscript 在处理特制 .eps 文档时存在类型混淆(CWE-843/CWE-704),攻击者可在 /OutputFile (%pipe% 子串配合 .rsdparams 的情况下绕过 -dSAFER 沙箱并执行任意命令。该漏洞于 2017 年 4 月被发现在野利用,且可通过 ImageMagick、Pillow 等调用 Ghostscript 的库间接触发。任何运行 gs 处理不可信 PostScript/EPS 输入的服务器(尤其是图片转换、文档预览、打印服务)都应关注。

严重性

CVSS 3.1 评分 7.8(high),综合风险分 84.59/100;EPSS 30 天利用概率 97.0%(百分位 99.9%,日期 2026-11-24)。攻击面为 gs 程序对不可信 .eps 输入的解析路径,属可远程触发的命令执行。

利用状态

CISA KEV 已收录(2022-05-24),KEV 要求动作「Apply updates per vendor instructions.」,期限 2022-06-14;CISA SSVC:automatable=no / exploitation=active / technical_impact=total。Exploit-DB 存在公开 PoC(3 条,含 41955 Metasploit 模块,Rank=ExcellentRanking)。勒索软件关联状态材料未给出;Nuclei 状态材料未给出。核查日期 2026-11-24。

受影响产品

Artifex Ghostscript through 2017-04-26(官方记录表述);参考材料中的 Metasploit 模块称影响 Ghostscript 9.21 及更早版本,与官方「through 2017-04-26」表述存在出入,以官方记录为准。受影响组件为 gs 程序及其 .eps 解析路径;部署形态包括直接调用 gs 的服务,以及经 ImageMagick、Pillow 等库间接调用 Ghostscript 的图片/文档处理链路。具体版本区间材料未给出。

修复版本

材料未给出官方修复版本号;参考链接中列有 Debian DSA-3838、Red Hat RHSA-2017:1230 等厂商公告,但材料未给出其对应修复版本细节。

缓解措施

无法立即修复时,应避免用 gs 处理不可信 .eps/PostScript 输入;在调用链上禁用或限制 ImageMagick/Pillow 对 Ghostscript 的委托;按 KEV 要求动作「Apply updates per vendor instructions.」尽快跟进厂商更新;对相关服务实施最小权限与出站网络限制,降低命令执行后的影响。

响应步骤

  1. 排查所有直接或间接调用 Ghostscript 的服务与组件(含 ImageMagick、Pillow 委托路径),确认是否处理外部不可信输入。
  2. 核对 gs 版本与厂商公告(DSA-3838、RHSA-2017:1230 等),按厂商说明应用更新。
  3. 检查是否存在 /OutputFile (%pipe% 等可疑 .eps 输入痕迹及异常子进程/出站连接。
  4. 对暂不能修复的实例,临时禁用不可信 EPS 处理或隔离相关转换服务。
  5. 将 CVE-2017-8291 纳入 KEV 跟踪清单,复核期限 2022-06-14 的整改状态并记录。

参考来源

  1. https://nvd.nist.gov/vuln/detail/CVE-2017-8291kev
  2. https://www.exploit-db.com/exploits/41955exploit,exploitdb
  3. http://www.debian.org/security/2017/dsa-3838vendor-advisory,x_refsource_DEBIAN,vendor-advisory,x_refsource_DEBIAN,x_transfer
  4. https://bugzilla.suse.com/show_bug.cgi?id=1036453x_refsource_MISC,x_refsource_MISC,x_transferred,advisory,euvd
  5. https://access.redhat.com/errata/RHSA-2017:1230vendor-advisory,x_refsource_REDHAT,vendor-advisory,x_refsource_REDHAT,x_transfer
  6. http://www.securityfocus.com/bid/98476vdb-entry,x_refsource_BID,vdb-entry,x_refsource_BID,x_transferred,advisory,euvd
  7. https://www.exploit-db.com/exploits/41955/exploit,x_refsource_EXPLOIT-DB,exploit,x_refsource_EXPLOIT-DB,x_transferred,advi
  8. http://openwall.com/lists/oss-security/2017/04/28/2x_refsource_MISC,x_refsource_MISC,x_transferred,advisory,euvd
  9. https://security.gentoo.org/glsa/201708-06vendor-advisory,x_refsource_GENTOO,vendor-advisory,x_refsource_GENTOO,x_transfer
  10. https://bugzilla.redhat.com/show_bug.cgi?id=1446063x_refsource_MISC,x_refsource_MISC,x_transferred,advisory,euvd
  11. https://git.ghostscript.com/?p=ghostpdl.git%3Ba=commit%3Bh=04b37bbce174eed24edec7ad5b920eb93db4d47dx_refsource_CONFIRM,x_refsource_CONFIRM,x_transferred,advisory,euvd
  12. https://bugs.ghostscript.com/show_bug.cgi?id=697808x_refsource_MISC,x_refsource_MISC,x_transferred,advisory,euvd
  13. https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2017-8291government-resource
  14. https://github.com/rapid7/metasploit-framework/tree/master/modules/exploit_unix/fileformat/ghostscript_type_confusionexploit,metasploit
  15. https://bugs.ghostscript.com/show_bug.cgi?id=697799kev
  16. https://www.cve.org/CVERecord?id=CVE-2017-8291kev