cve.bz

CVE-2018-16509

7.8 highExploitEPSS 92%

High (7.8). EPSS 92% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.0

7.8 high
CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
92% (unchanged from 92% a week ago; 92% 30 days ago) estimated probability of exploitation activity in the next 30 days; 100th percentile. Scored 2026-11-21. A forecast for this CVE across the internet, not for your own systems.
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2018-16509 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2018-16509?via=ask-ai-copy and https://cve.bz/cve/CVE-2018-16509?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2018-16509 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
debian:debian_linux8.0
debian:debian_linux9.0
artifex:ghostscriptbefore 9.24
canonical:ubuntu_linux14.04
canonical:ubuntu_linux16.04
canonical:ubuntu_linux18.04
redhat:enterprise_linux_desktop6.0
redhat:enterprise_linux_desktop7.0
redhat:enterprise_linux_server6.0
redhat:enterprise_linux_server7.0
redhat:enterprise_linux_server_eus7.5
redhat:enterprise_linux_workstation6.0
redhat:enterprise_linux_workstation7.0
artifex:gpl_ghostscriptbefore 9.26

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian8ghostscript9.06~dfsg-2+deb8u8DLA-1504-1
Debian9ghostscript9.20~dfsg-3.2+deb9u5DSA-4294-1
Debian12, 13, 14ghostscript9.25~dfsg-1DEBIAN-CVE-2018-16509
Ubuntu14.04:LTSghostscript9.10~dfsg-0ubuntu10.13UBUNTU-CVE-2018-16509 USN-3768-1
Ubuntu16.04:LTSghostscript9.18~dfsg~0-0ubuntu2.9UBUNTU-CVE-2018-16509 USN-3768-1
Ubuntu18.04:LTSghostscript9.22~dfsg+1-0ubuntu1.2UBUNTU-CVE-2018-16509 USN-3768-1
Red Hatenterprise_linux:6::client, enterprise_linux:6::computenode, enterprise_linux:6::server and 1 moreghostscript, ghostscript-doc, ghostscript-gtk and 2 more0:8.70-24.el6_10.2RHSA-2018:3760
Red Hatenterprise_linux:7::client, enterprise_linux:7::computenode, enterprise_linux:7::server and 1 moreghostscript, ghostscript-doc, ghostscript-gtk and 3 more0:9.07-29.el7_5.2RHSA-2018:2918
SUSEEnterprise Storage 4, Linux Enterprise Desktop 12 SP3, Linux Enterprise Server 12 SP1-LTSS and 7 moreghostscript9.25-23.13.1SUSE-SU-2018:2975-1
SUSELinux Enterprise Module for Basesystem 15ghostscript9.25-3.6.1SUSE-SU-2018:2976-1
SUSELinux Enterprise Module for Desktop Applications 15libspectre0.2.8-3.2.1SUSE-SU-2018:2976-1
SUSELinux Enterprise Point of Sale 11 SP3, Linux Enterprise Server 11 SP3-LTSS, Linux Enterprise Server 11 SP3-TERADATA and 3 moreghostscript-library8.62-32.47.13.1SUSE-SU-2018:3330-1
SUSELinux Enterprise Server 12 SP2-BCLghostscript9.25-23.13.1SUSE-SU-2018:2975-2
SUSELinux Enterprise Server for SAP Applications 12 SP1ghostscript9.25-23.13.1SUSE-SU-2018:2975-3
openSUSETumbleweedghostscript9.54.0-2.2openSUSE-SU-2024:10783-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This issue did affect the versions of ghostscript as shipped with Red Hat Enterprise Linux 5, 6, and 7.

Red Hat Enterprise Linux 5 is now in Extended Life Phase of the support and maintenance life cycle. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Red Hat Enterprise Linux Life Cycle: https://access.redhat.com/support/policy/updates/errata/.

Red Hat's mitigation

* ImageMagick relies on ghostscript when processing certain files formats. Thus, ImageMagick can be used as an attack vector. In order to prevent ImageMagick from processing those files on Red Hat Enterprise Linux 6 and 7, you can disable the use of ghostscript and the processing of PS, EPS, PDF, and XPS file formats in ImageMagick's security policy by opening /etc/ImageMagick/policy.xml and adding the following lines to the "<policymap>" section of the file:

```

<policy domain="coder" rights="none" pattern="PS" />

<policy domain="coder" rights="none" pattern="EPS" />

<policy domain="coder" rights="none" pattern="PDF" />

<policy domain="coder" rights="none" pattern="XPS" />

<policy domain="delegate" rights="none" pattern="gs" />

```

* Additionally, this issue can be triggered when processing files in order to generate thumbnails, for example when browsing a folder containing a malicious PostScript file in Nautilus. To prevent this, remove or rename the "/usr/bin/evince-thumbnailer" executable.

In Red Hat Enterprise Linux v.7.6 and above, the thumbnailing is done in a sandbox.

* It is possible to run PDF/PS viewers, such as evince and okular, in a SELinux sandbox using the `sandbox` command from the policycoreutils-sandbox package :

$ sandbox -X evince <untrusted-file.pdf>

The sandbox will prevent an attacker to make modifications on the file system.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 6ghostscript-0:8.70-24.el6_10.2Fixed 2018-12-03RHSA-2018:3760
Red Hat Enterprise Linux 7ghostscript-0:9.07-29.el7_5.2Fixed 2018-10-16RHSA-2018:2918
Red Hat Enterprise Linux 5ghostscriptWill not fix
Red Hat Enterprise Linux 8ghostscriptNot affected
Red Hat OpenShift Container Platform 3.10mediawikiNot affected
Red Hat OpenShift Container Platform 3.11mediawikiNot affected
Red Hat OpenShift Container Platform 3.2mediawikiNot affected
Red Hat OpenShift Container Platform 3.3mediawikiNot affected
Red Hat OpenShift Container Platform 3.4mediawikiNot affected
Red Hat OpenShift Container Platform 3.5mediawikiNot affected
Red Hat OpenShift Container Platform 3.6mediawikiNot affected
Red Hat OpenShift Container Platform 3.7mediawikiNot affected
Red Hat OpenShift Container Platform 3.9mediawikiNot affected
Red Hat OpenShift Enterprise 3.0mediawikiNot affected
Red Hat OpenShift Enterprise 3.1mediawikiNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2018-16509.

Public exploits

GitHub PoC (unverified)

Repositories on GitHub named after this CVE. Nobody has checked them and they are not scanned: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it.

References

Check your stackJSON