← Vulnerability feed

Vulnerability record · CVE-2018-16509 · published 5 September 2018

CVE-2018-16509: Ghostscript privilege restoration flaw allows code execution via crafted PostScript

Debian · Debian Linux

Ghostscript before 9.24 incorrectly checks restoration of privilege when handling /invalidaccess exceptions. An attacker who can supply crafted PostScript can abuse this to execute code through the pipe instruction. Because Ghostscript is commonly invoked by document converters and print pipelines, untrusted input reaching it can lead to code execution.

7.8 CVSS 3.0 High EPSS 92% · top 0.2%
7.8CVSS 3.0 base score, v2 9.3
92%EPSS exploitation probability, 30 days
NoNot in CISA KEV
8Affected product versions listed by NVD
30References, 4 tagged exploit
17 Jun 2026Last modified by NVD

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.

CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 18 September 2026. Confidence: high.

high priorityCVSS 7.8 with public exploit code and a very high EPSS probability make this a serious risk for any environment still running unpatched Ghostscript, even though it is not in CISA KEV.

What it is

Ghostscript before 9.24 incorrectly checks restoration of privilege when handling /invalidaccess exceptions. An attacker who can supply crafted PostScript can abuse this to execute code through the pipe instruction. Because Ghostscript is commonly invoked by document converters and print pipelines, untrusted input reaching it can lead to code execution.

Impact

An attacker gains arbitrary code execution in the context of the process handling the PostScript, which may be a document converter, print spooler or similar service. This can lead to full compromise of that process and, depending on its privileges, the host.

Attack surface

Reached by supplying a crafted PostScript file to a Ghostscript-based processing path; the CVSS vector is local with user interaction required, so the victim or an automated pipeline must open or process the malicious document. No authentication is needed by the attacker, but the attack depends on the target processing attacker-controlled PostScript.

Exploitation

Public exploit code exists (Exploit-DB 45369 and an oss-sec post tagged Exploit), and EPSS is very high at 0.925 (99.8th percentile), though CISA KEV does not list it. No ransomware group usage is documented in the record.

What to do

  • Upgrade Ghostscript to 9.24 or later, or apply the vendor patches referenced in the Ghostscript git commits and distribution advisories (Red Hat RHSA-2018:2918/RHSA-2018:3760, Debian DSA-4294, Ubuntu USN-3768-1).
  • If immediate patching is not possible, restrict Ghostscript processing of untrusted PostScript/PDF input, for example by disabling or sandboxing the pipe instruction and related file operations.
  • Run Ghostscript-based converters and print pipelines with least privilege and in a sandbox or container to limit the impact of code execution.
  • Block or strip PostScript input from untrusted sources at mail gateways, upload endpoints and document conversion services until patched.

Detection

  • Monitor for Ghostscript processes spawning unexpected child processes or shells, which would indicate abuse of the pipe instruction.
  • Alert on Ghostscript crashes or /invalidaccess exception handling anomalies in application logs, which may indicate exploitation attempts.
  • Inspect document conversion and print pipelines for PostScript files containing pipe instructions or unusual /invalidaccess handling.
  • Use file and process telemetry to detect PostScript files written to disk followed by Ghostscript execution in web or mail processing contexts.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

8 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

LinkTags
http://git.ghostscript.com/?p=ghostpdl.git%3Ba=commit%3Bh=5516c614dc33662a2afdc377159f70218e67bde5
http://git.ghostscript.com/?p=ghostpdl.git%3Ba=commit%3Bh=78911a01b67d590b4a91afac2e8417360b934156
http://git.ghostscript.com/?p=ghostpdl.git%3Ba=commit%3Bh=79cccf641486a6595c43f1de1cd7ade696020a31
http://git.ghostscript.com/?p=ghostpdl.git%3Ba=commitdiff%3Bh=520bb0ea7519aa3e79db78aaf0589dae02103764
http://seclists.org/oss-sec/2018/q3/142 ExploitMailing ListThird Party Advisory
http://www.securityfocus.com/bid/105122 Third Party AdvisoryVDB Entry
https://access.redhat.com/errata/RHSA-2018:2918 Third Party Advisory
https://access.redhat.com/errata/RHSA-2018:3760 Third Party Advisory
https://bugs.ghostscript.com/show_bug.cgi?id=699654 Issue TrackingPermissions RequiredThird Party Advisory
https://lists.debian.org/debian-lts-announce/2018/09/msg00015.html Mailing ListThird Party Advisory
https://security.gentoo.org/glsa/201811-12 Third Party Advisory
https://usn.ubuntu.com/3768-1/ Third Party Advisory
https://www.artifex.com/news/ghostscript-security-resolved/ Vendor Advisory
https://www.debian.org/security/2018/dsa-4294 Third Party Advisory
https://www.exploit-db.com/exploits/45369/ ExploitThird Party AdvisoryVDB Entry
http://git.ghostscript.com/?p=ghostpdl.git%3Ba=commit%3Bh=5516c614dc33662a2afdc377159f70218e67bde5
http://git.ghostscript.com/?p=ghostpdl.git%3Ba=commit%3Bh=78911a01b67d590b4a91afac2e8417360b934156
http://git.ghostscript.com/?p=ghostpdl.git%3Ba=commit%3Bh=79cccf641486a6595c43f1de1cd7ade696020a31
http://git.ghostscript.com/?p=ghostpdl.git%3Ba=commitdiff%3Bh=520bb0ea7519aa3e79db78aaf0589dae02103764
http://seclists.org/oss-sec/2018/q3/142 ExploitMailing ListThird Party Advisory
http://www.securityfocus.com/bid/105122 Third Party AdvisoryVDB Entry
https://access.redhat.com/errata/RHSA-2018:2918 Third Party Advisory
https://access.redhat.com/errata/RHSA-2018:3760 Third Party Advisory
https://bugs.ghostscript.com/show_bug.cgi?id=699654 Issue TrackingPermissions RequiredThird Party Advisory
https://lists.debian.org/debian-lts-announce/2018/09/msg00015.html Mailing ListThird Party Advisory
https://security.gentoo.org/glsa/201811-12 Third Party Advisory
https://usn.ubuntu.com/3768-1/ Third Party Advisory
https://www.artifex.com/news/ghostscript-security-resolved/ Vendor Advisory
https://www.debian.org/security/2018/dsa-4294 Third Party Advisory
https://www.exploit-db.com/exploits/45369/ ExploitThird Party AdvisoryVDB Entry

Track CVE-2018-16509 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2025-32433Erlang/OTP SSH server missing authentication allows remote code executionErlang/OTP SSH servers before OTP-27.3.3, OTP-26.2.5.11 and OTP-25.3.2.20 mishandle SSH protocol messages, letting an unauthenticated attacker execut…KEVEPSS 99%analysed10.0CVE-2025-24201Apple WebKit out-of-bounds write allows sandbox escapeCVE-2025-24201 is an out-of-bounds write in Apple's WebKit that was addressed with improved checks. Maliciously crafted web content may break out of …KEVEPSS 3.8%analysed10.0CVE-2021-44228Apache Log4j2 JNDI lookup remote code executionApache Log4j2 versions 2.0-beta9 through 2.15.0 (excluding 2.12.2, 2.12.3, and 2.3.1) do not protect against attacker-controlled LDAP and other JNDI …KEVEPSS 100%analysed9.8CVE-2026-24061GNU Inetutils telnetd argument injection allows remote auth bypasstelnetd in GNU Inetutils through 2.7 fails to sanitize the USER environment variable, so a value such as "-f root" is passed as an argument to login …KEVEPSS 99%analysed9.8CVE-2025-39682Linux kernel TLS zero-length record handling flaw on rx_listThe Linux kernel TLS receive path mishandles zero-length records that arrive from the rx_list, breaking the assumption that a record type change cann…KEVEPSS 2.9%analysed9.8CVE-2025-24813Apache Tomcat Default Servlet path equivalence enables RCE and file disclosureApache Tomcat mishandles path equivalence for names containing an internal dot, letting a remote unauthenticated attacker write files through the Def…KEVEPSS 100%analysed9.8CVE-2024-9680Mozilla Firefox and Thunderbird use-after-free in Animation timelinesA use-after-free flaw in Animation timelines allows an attacker to execute code in the content process of Firefox and Thunderbird. Mozilla reports ex…KEVEPSS 23%analysed9.8CVE-2023-46604Apache ActiveMQ OpenWire deserialization remote code executionThe Java OpenWire protocol marshaller in Apache ActiveMQ deserializes untrusted data, letting an attacker manipulate serialized class types so the br…KEVEPSS 100%analysed

Source: NIST National Vulnerability Database (record CVE-2018-16509), CISA KEV, FIRST EPSS (scores of 2026-09-24). This page is refreshed as NVD updates the record.