CVE-2018-16509
Description
A flaw in Ghostscript's privilege restoration when handling /invalidaccess exceptions allows attackers to execute arbitrary commands via crafted PostScript files.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A flaw in Ghostscript's privilege restoration when handling /invalidaccess exceptions allows attackers to execute arbitrary commands via crafted PostScript files.
Vulnerability
An issue was discovered in Artifex Ghostscript before version 9.24 [1][2][3]. The bug lies in incorrect restoration of privilege checking during handling of /invalidaccess exceptions. When a specially crafted PostScript file triggers such an exception, the privilege checks that normally restrict the pipe instruction are bypassed. This allows an attacker to execute arbitrary system commands via the pipe operator in the PostScript language [1][2][3][4]. The vulnerability affects Ghostscript versions prior to 9.24 [1][2][3].
Exploitation
An attacker can exploit this vulnerability by providing a crafted PostScript (.ps) file to a system or service that processes such files using a vulnerable version of Ghostscript [3]. No authentication is required, and the attack can be triggered remotely if the victim opens the file with Ghostscript or through an application that uses Ghostscript (e.g., document conversion or preview services) [3][4]. The crafted file contains PostScript code that triggers an /invalidaccess exception, causing the privilege restoration to fail and allowing the pipe instruction to execute with elevated privileges, leading to arbitrary command execution [4]. The exploit does not require any special user interaction beyond opening the file [4].
Impact
Successful exploitation allows an attacker to execute arbitrary operating system commands in the context of the Ghostscript process [1][2][3][4]. This leads to a complete compromise of confidentiality, integrity, and availability of the affected system. An attacker could read sensitive files, modify data, install malware, or cause denial of service. The impact is particularly severe for servers that automatically process uploaded PostScript files or share documents [3].
Mitigation
The vulnerability is fixed in Ghostscript version 9.24 [1][2][3]. Red Hat Enterprise Linux 7 users should update to ghostscript-9.07-29.el7_5.2 [1]. Ubuntu users should update to ghostscript 9.22~dfsg+1-0ubuntu1.2 (for 18.04 LTS) or later as per the Ubuntu Security Notice USN-3768-1 [3]. There is no known workaround other than applying the patch. Administrators should ensure they are running a patched version and limit processing of untrusted PostScript files until patching is possible [3].
AI Insight generated on May 26, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
22- Range: <9.24
- osv-coords21 versionspkg:rpm/opensuse/ghostscript&distro=openSUSE%20Tumbleweedpkg:rpm/suse/ghostscript&distro=SUSE%20Enterprise%20Storage%204pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Desktop%2012%20SP3pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP1-LTSSpkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-BCLpkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-LTSSpkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%2012-LTSSpkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP1pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP2pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP3pkg:rpm/suse/ghostscript&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP3pkg:rpm/suse/ghostscript&distro=SUSE%20OpenStack%20Cloud%207pkg:rpm/suse/ghostscript-library&distro=SUSE%20Linux%20Enterprise%20Point%20of%20Sale%2011%20SP3pkg:rpm/suse/ghostscript-library&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP3-LTSSpkg:rpm/suse/ghostscript-library&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP3-TERADATApkg:rpm/suse/ghostscript-library&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4pkg:rpm/suse/ghostscript-library&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2011%20SP4pkg:rpm/suse/ghostscript-library&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2011%20SP4pkg:rpm/suse/libspectre&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015
< 9.54.0-2.2+ 20 more
- (no CPE)range: < 9.54.0-2.2
- (no CPE)range: < 9.25-23.13.1
- (no CPE)range: < 9.25-23.13.1
- (no CPE)range: < 9.25-3.6.1
- (no CPE)range: < 9.25-23.13.1
- (no CPE)range: < 9.25-23.13.1
- (no CPE)range: < 9.25-23.13.1
- (no CPE)range: < 9.25-23.13.1
- (no CPE)range: < 9.25-23.13.1
- (no CPE)range: < 9.25-23.13.1
- (no CPE)range: < 9.25-23.13.1
- (no CPE)range: < 9.25-23.13.1
- (no CPE)range: < 9.25-23.13.1
- (no CPE)range: < 9.25-23.13.1
- (no CPE)range: < 8.62-32.47.13.1
- (no CPE)range: < 8.62-32.47.13.1
- (no CPE)range: < 8.62-32.47.13.1
- (no CPE)range: < 8.62-32.47.13.1
- (no CPE)range: < 8.62-32.47.13.1
- (no CPE)range: < 8.62-32.47.13.1
- (no CPE)range: < 0.2.8-3.2.1
Patches
0No patches discovered yet.
Vulnerability mechanics
No source-code context for this CVE — mechanics is only generated when we can read the actual fix diff. Without that, the four sections (root cause, attack vector, affected code, fix) would be speculation rather than analysis.
References
15- www.exploit-db.com/exploits/45369/mitreexploitx_refsource_EXPLOIT-DB
- access.redhat.com/errata/RHSA-2018:2918mitrevendor-advisoryx_refsource_REDHAT
- access.redhat.com/errata/RHSA-2018:3760mitrevendor-advisoryx_refsource_REDHAT
- security.gentoo.org/glsa/201811-12mitrevendor-advisoryx_refsource_GENTOO
- usn.ubuntu.com/3768-1/mitrevendor-advisoryx_refsource_UBUNTU
- www.debian.org/security/2018/dsa-4294mitrevendor-advisoryx_refsource_DEBIAN
- git.ghostscript.commitrex_refsource_MISC
- git.ghostscript.commitrex_refsource_MISC
- git.ghostscript.commitrex_refsource_MISC
- git.ghostscript.commitrex_refsource_CONFIRM
- seclists.org/oss-sec/2018/q3/142mitrex_refsource_MISC
- www.securityfocus.com/bid/105122mitrevdb-entryx_refsource_BID
- bugs.ghostscript.com/show_bug.cgimitrex_refsource_MISC
- lists.debian.org/debian-lts-announce/2018/09/msg00015.htmlmitremailing-listx_refsource_MLIST
- www.artifex.com/news/ghostscript-security-resolved/mitrex_refsource_MISC
News mentions
0No linked articles in our index yet.