{"answers":{"affected":"It affects 8 products.","exploited":"Yes. Attackers have exploited CVE-2017-8291 in the wild since at least 24 May 2022.","fix":"Apply the vendor's patch. US federal agencies must fix it by 14 Jun 2022.","what":"CVE-2017-8291 is a high-severity code injection vulnerability in Artifex Ghostscript, published on 27 Apr 2017. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2017-8291 and fix it if it is affected.\n\nWhat it is: CVE-2017-8291 is a high-severity code injection vulnerability in Artifex Ghostscript, published on 27 Apr 2017. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: Yes. Attackers have exploited CVE-2017-8291 in the wild since at least 24 May 2022.\n\nAffected product: Artifex Ghostscript. No package-level version data is available, so check the vendor advisory linked from the reference page.\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2017-8291/ (Markdown: https://insights.sbomify.com/CVE-2017-8291/index.md)","id":"CVE-2017-8291","markdown":"https://insights.sbomify.com/CVE-2017-8291/index.md","name":"CVE-2017-8291","record":{"aliases":["ALPINE-CVE-2017-8291","DEBIAN-CVE-2017-8291","DLA-932-1","GHSA-rh88-cwv2-gjxm","RHSA-2017:1230","SUSE-SU-2017:1153-1","SUSE-SU-2017:1322-1","UBUNTU-CVE-2017-8291"],"analysis":{"component_type":"library","fix_type":"patch","impacts":["code_execution","security_bypass"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Ghostscript library","requires_auth":"none","summary":"Attackers can execute arbitrary commands by bypassing the -dSAFER sandbox via type confusion in crafted EPS files processed by Ghostscript.","user_interaction":"required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"mitre","cpe":[{"product":"ghostscript","vendor":"artifex"},{"product":"debian_linux","vendor":"debian"},{"product":"enterprise_linux_desktop","vendor":"redhat"},{"product":"enterprise_linux_eus","vendor":"redhat"},{"product":"enterprise_linux_server","vendor":"redhat"},{"product":"enterprise_linux_server_aus","vendor":"redhat"},{"product":"enterprise_linux_server_tus","vendor":"redhat"},{"product":"enterprise_linux_workstation","vendor":"redhat"}],"cvss":{"score":7.8,"severity":"high","source":"cisa-adp","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-843","name":"Access of Resource Using Incompatible Type"}],"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.","ecosystems":["Red Hat:enterprise_linux:6::client","Red Hat:enterprise_linux:6::computenode","Red Hat:enterprise_linux:6::server","Red Hat:enterprise_linux:6::workstation","Red Hat:enterprise_linux:7::client","Red Hat:enterprise_linux:7::computenode","Red Hat:enterprise_linux:7::server","Red Hat:enterprise_linux:7::workstation","SUSE:Linux Enterprise Point of Sale 11 SP3","SUSE:Linux Enterprise Server 11 SP3-LTSS","SUSE:Linux Enterprise Server 11 SP3-TERADATA","SUSE:Linux Enterprise Server 11 SP4","SUSE:Linux Enterprise Server for SAP Applications 11 SP4","SUSE:Linux Enterprise Software Development Kit 11 SP4","SUSE:OpenStack Cloud 5"],"exploits":{"exploitdb":2,"first_seen":"2017-04-27","github_poc":2,"max_poc_stars":0,"metasploit":1,"nuclei":0,"refs":[{"date":"2017-04-27","kind":"metasploit","ref":"exploit/unix/fileformat/ghostscript_type_confusion","stars":null,"title":"Ghostscript Type Confusion Arbitrary Command Execution"},{"date":"2017-05-02","kind":"exploitdb","ref":"41955","stars":null,"title":"Ghostscript 9.21 - Type Confusion Arbitrary Command Execution (Metasploit)"},{"date":"2017-05-02","kind":"exploitdb","ref":"41955","stars":null,"title":"Ghostscript 9.21 - Type Confusion Arbitrary Command Execution (Metasploit)"},{"date":"2025-06-13T09:22:04Z","kind":"github_poc","ref":"https://github.com/hkcfs/PIL-CVE-2017-8291","stars":0,"title":"CVE-2017-8291 CTF with docker and examples"},{"date":"2025-12-03T16:08:59Z","kind":"github_poc","ref":"https://github.com/DaniilOrchikov/PIL-CVE-2017-8291","stars":0,"title":null}],"tier":"exploited"},"has_fix":true,"headline":"Artifex Ghostscript Type Confusion","id":"CVE-2017-8291","indexable":true,"kev":{"dateAdded":"2022-05-24","dueDate":"2022-06-14","knownRansomwareCampaignUse":"Unknown","product":"Ghostscript","requiredAction":"Apply updates per vendor instructions.","vendorProject":"Artifex","vulnerabilityName":"Artifex Ghostscript Type Confusion Vulnerability"},"kind":"cve","links":{"ecosystem":null,"product":"artifex:ghostscript","products":["artifex:ghostscript","debian:debian_linux","redhat:enterprise_linux_desktop","redhat:enterprise_linux_eus","redhat:enterprise_linux_server","redhat:enterprise_linux_server_aus","redhat:enterprise_linux_server_tus","redhat:enterprise_linux_workstation"],"type":"code_injection","year":"2017"},"n_packages":54,"n_references":10,"next":{"headline":"Denial of service in n/a","id":"CVE-2017-8294"},"packages":[{"ecosystem":"Red Hat:enterprise_linux:6::client","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript","purl":"pkg:rpm/redhat/ghostscript","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::client","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-debuginfo","purl":"pkg:rpm/redhat/ghostscript-debuginfo","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::client","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-devel","purl":"pkg:rpm/redhat/ghostscript-devel","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::client","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-doc","purl":"pkg:rpm/redhat/ghostscript-doc","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::client","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-gtk","purl":"pkg:rpm/redhat/ghostscript-gtk","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::computenode","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript","purl":"pkg:rpm/redhat/ghostscript","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::computenode","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-debuginfo","purl":"pkg:rpm/redhat/ghostscript-debuginfo","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::computenode","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-devel","purl":"pkg:rpm/redhat/ghostscript-devel","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::computenode","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-doc","purl":"pkg:rpm/redhat/ghostscript-doc","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::computenode","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-gtk","purl":"pkg:rpm/redhat/ghostscript-gtk","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::server","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript","purl":"pkg:rpm/redhat/ghostscript","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::server","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-debuginfo","purl":"pkg:rpm/redhat/ghostscript-debuginfo","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::server","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-devel","purl":"pkg:rpm/redhat/ghostscript-devel","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::server","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-doc","purl":"pkg:rpm/redhat/ghostscript-doc","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::server","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-gtk","purl":"pkg:rpm/redhat/ghostscript-gtk","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::workstation","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript","purl":"pkg:rpm/redhat/ghostscript","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::workstation","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-debuginfo","purl":"pkg:rpm/redhat/ghostscript-debuginfo","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::workstation","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-devel","purl":"pkg:rpm/redhat/ghostscript-devel","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::workstation","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-doc","purl":"pkg:rpm/redhat/ghostscript-doc","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:6::workstation","fixed":["0:8.70-23.el6_9.2"],"introduced":["0"],"last_affected":[],"package":"ghostscript-gtk","purl":"pkg:rpm/redhat/ghostscript-gtk","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::client","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript","purl":"pkg:rpm/redhat/ghostscript","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::client","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-cups","purl":"pkg:rpm/redhat/ghostscript-cups","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::client","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-debuginfo","purl":"pkg:rpm/redhat/ghostscript-debuginfo","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::client","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-devel","purl":"pkg:rpm/redhat/ghostscript-devel","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::client","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-doc","purl":"pkg:rpm/redhat/ghostscript-doc","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::client","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-gtk","purl":"pkg:rpm/redhat/ghostscript-gtk","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::computenode","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript","purl":"pkg:rpm/redhat/ghostscript","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::computenode","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-cups","purl":"pkg:rpm/redhat/ghostscript-cups","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::computenode","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-debuginfo","purl":"pkg:rpm/redhat/ghostscript-debuginfo","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::computenode","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-devel","purl":"pkg:rpm/redhat/ghostscript-devel","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::computenode","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-doc","purl":"pkg:rpm/redhat/ghostscript-doc","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::computenode","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-gtk","purl":"pkg:rpm/redhat/ghostscript-gtk","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::server","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript","purl":"pkg:rpm/redhat/ghostscript","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::server","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-cups","purl":"pkg:rpm/redhat/ghostscript-cups","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::server","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-debuginfo","purl":"pkg:rpm/redhat/ghostscript-debuginfo","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::server","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-devel","purl":"pkg:rpm/redhat/ghostscript-devel","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::server","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-doc","purl":"pkg:rpm/redhat/ghostscript-doc","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::server","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-gtk","purl":"pkg:rpm/redhat/ghostscript-gtk","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::workstation","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript","purl":"pkg:rpm/redhat/ghostscript","source":"RHSA-2017:1230"},{"ecosystem":"Red Hat:enterprise_linux:7::workstation","fixed":["0:9.07-20.el7_3.5"],"introduced":["0"],"last_affected":[],"package":"ghostscript-cups","purl":"pkg:rpm/redhat/ghostscript-cups","source":"RHSA-2017:1230"}],"prev":{"headline":"Memory corruption in n/a","id":"CVE-2017-8290"},"products":["n/a"],"published":"2017-04-27","related":[{"cvss_score":9.9,"headline":"Command injection in ghostscript","id":"CVE-2021-3781","kev_date_added":null,"published":"2022-02-16"},{"cvss_score":9.8,"headline":"Memory corruption in n/a","id":"CVE-2025-27831","kev_date_added":null,"published":"2025-03-25"},{"cvss_score":9.8,"headline":"Memory corruption in n/a","id":"CVE-2025-27832","kev_date_added":null,"published":"2025-03-25"},{"cvss_score":9.8,"headline":"Memory corruption in n/a","id":"CVE-2025-27836","kev_date_added":null,"published":"2025-03-25"},{"cvss_score":9.8,"headline":"An issue was discovered in Artifex Ghostscript before 10.05.0.","id":"CVE-2025-27837","kev_date_added":null,"published":"2025-03-25"},{"cvss_score":9.8,"headline":"Use after free in n/a","id":"CVE-2020-36773","kev_date_added":null,"published":"2024-02-04"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"Red Hat","prefix":"RHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"open","licence":"CC0 1.0","name":"CISA KEV"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"attribution","licence":"BSD-3-Clause","name":"Metasploit"},{"class":"attribution","licence":"GPL-2.0-or-later","name":"Exploit-DB"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"active","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-10-21","vendors":["n/a"]},"summary":"Attackers can execute arbitrary commands by bypassing the -dSAFER sandbox via type confusion in crafted EPS files processed by Ghostscript.","url":"https://insights.sbomify.com/CVE-2017-8291/"}