VulnarioBlogGhostscript vulnerabilities
Ghostscript Vulnerabilities: The 10 Most Critical Ghostscript Security Bugs (CVEs)
Ghostscript vulnerabilities are security flaws in Ghostscript that attackers can abuse to steal data, take over a server or interrupt a service. Ghostscript is an interpreter for PostScript and PDF used by many document pipelines. The National Vulnerability Database (NVD) lists 139 CVEs for Ghostscript, 12 of them rated critical, and none were published in the last 12 months. CISA lists 1 of them in its Known Exploited Vulnerabilities (KEV) catalog, which means attackers have used them against real systems.
This guide lists the 10 most critical Ghostscript security bugs, with the CVE number, CVSS score, affected versions and what to do about each one. It also covers Ghostscript security basics and a free way to be told about the next Ghostscript CVE as soon as it is published.
Key takeaways
- 1 CVE is in CISA's KEV catalog, so attackers have exploited it in the wild.
- 12 Ghostscript CVEs are rated critical (CVSS v3), and 0 new ones were published in the last 12 months.
- The newest CVE in this guide is CVE-2025-27831, published Mar 25, 2025.
- You can monitor Ghostscript for free. Vulnario emails you when a new CVE matches your version and the rest of your stack.
How we ranked these Ghostscript CVEs
We ranked CVEs first by whether CISA lists them as exploited, then by CVSS score (v3 scores before the older v2 scale, which is marked when used), then by publication date (newest first). When a technology has several product entries in NVD, we combined them and removed duplicates. This favors the bugs that matter most in practice, so the guide is a list of the most critical flaws we found, not a complete history.
Every CVE number, score, date and affected version below comes from the NVD record and the CISA KEV catalog, checked on Nov 3, 2026. Scores can change when NVD reanalyzes a record, so open the linked record if you need the current value.
The 10 most critical Ghostscript CVEs at a glance
| # | CVE | CVSS | Published | Type | CISA KEV |
|---|---|---|---|---|---|
| 1 | CVE-2017-8291 | 7.8 High | 2017-04-27 | Artifex Ghostscript Type Confusion | Yes |
| 2 | CVE-2021-3781 | 9.9 Critical | 2022-02-16 | Improper input validation | No |
| 3 | CVE-2025-27831 | 9.8 Critical | 2025-03-25 | Buffer overflow | No |
| 4 | CVE-2025-27832 | 9.8 Critical | 2025-03-25 | Buffer overflow | No |
| 5 | CVE-2025-27836 | 9.8 Critical | 2025-03-25 | Buffer overflow | No |
| 6 | CVE-2025-27837 | 9.8 Critical | 2025-03-25 | Path traversal | No |
| 7 | CVE-2020-36773 | 9.8 Critical | 2024-02-04 | Use after free | No |
| 8 | CVE-2023-28879 | 9.8 Critical | 2023-03-31 | Out-of-bounds write | No |
| 9 | CVE-2020-15900 | 9.8 Critical | 2020-07-28 | Out-of-bounds write | No |
| 10 | CVE-2019-14813 | 9.8 Critical | 2019-09-06 | Incorrect authorization | No |
Each Ghostscript CVE explained
1. CVE-2017-8291: Artifex Ghostscript Type Confusion
- What NVD says
- 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.
- How it can be attacked
- Can be exploited locally on the machine with low attack complexity, needing no privileges and user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- before 9.21
- What to do
- Upgrade to 9.21 or a later release, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
2. CVE-2021-3781: Improper input validation
- What NVD says
- A trivial sandbox (enabled with the `-dSAFER` option) escape flaw was found in the ghostscript interpreter by injecting a specially crafted pipe command. This flaw allows a specially crafted document to execute arbitrary commands on the system in the context of the ghostscript interpreter. The highest threat from this vulnerability is to confidentiality, integrity, as well as system availability.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing low privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 9.50; 9.52; 9.53.3; 9.54.0
- What to do
- Apply the vendor's security update for your release and restart the service. See the vendor advisory (opens in a new tab).
3. CVE-2025-27831: Buffer overflow
- What NVD says
- An issue was discovered in Artifex Ghostscript before 10.05.0. The DOCXWRITE TXTWRITE device has a text buffer overflow via long characters to devices/vector/doc_common.c.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- before 10.05.0
- What to do
- Upgrade to 10.05.0 or a later release, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
4. CVE-2025-27832: Buffer overflow
- What NVD says
- An issue was discovered in Artifex Ghostscript before 10.05.0. The NPDL device has a Compression buffer overflow for contrib/japanese/gdevnpdl.c.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- before 10.05.0
- What to do
- Upgrade to 10.05.0 or a later release, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
5. CVE-2025-27836: Buffer overflow
- What NVD says
- An issue was discovered in Artifex Ghostscript before 10.05.0. The BJ10V device has a Print buffer overflow in contrib/japanese/gdev10v.c.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- before 10.05.0
- What to do
- Upgrade to 10.05.0 or a later release, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
6. CVE-2025-27837: Path traversal
- What NVD says
- An issue was discovered in Artifex Ghostscript before 10.05.0. Access to arbitrary files can occur through a truncated path with invalid UTF-8 characters, for base/gp_mswin.c and base/winrtsup.cpp.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- before 10.05.0
- What to do
- Upgrade to 10.05.0 or a later release, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
7. CVE-2020-36773: Use after free
- What NVD says
- Artifex Ghostscript before 9.53.0 has an out-of-bounds write and use-after-free in devices/vector/gdevtxtw.c (for txtwrite) because a single character code in a PDF document can map to more than one Unicode code point (e.g., for a ligature).
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 9.51; 9.52; 9.52.1; 9.53.0
- What to do
- Apply the vendor's security update for your release and restart the service. See the vendor advisory (opens in a new tab).
8. CVE-2023-28879: Out-of-bounds write
- What NVD says
- In Artifex Ghostscript through 10.01.0, there is a buffer overflow leading to potential corruption of data internal to the PostScript interpreter, in base/sbcp.c. This affects BCPEncode, BCPDecode, TBCPEncode, and TBCPDecode. If the write buffer is filled to one byte less than full, and one then tries to write an escaped character, two bytes are written.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- before 10.01.0
- What to do
- Upgrade to 10.01.0 or a later release, then restart the service.
- Advisory
- Vendor advisory or patch (opens in a new tab)
9. CVE-2020-15900: Out-of-bounds write
- What NVD says
- A memory corruption issue was found in Artifex Ghostscript 9.50 and 9.52. Use of a non-standard PostScript operator can allow overriding of file access controls. The 'rsearch' calculation for the 'post' size resulted in a size that was too large, and could underflow to max uint32_t. This was fixed in commit 5d499272b95a6b890a1397e11d20937de000d31b.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 9.50; 9.52
- What to do
- Apply the vendor's security update for your release and restart the service. See the vendor advisory (opens in a new tab).
10. CVE-2019-14813: Incorrect authorization
- What NVD says
- A flaw was found in ghostscript, versions 9.x before 9.50, in the setsystemparams procedure where it did not properly secure its privileged calls, enabling scripts to bypass `-dSAFER` restrictions. A specially crafted PostScript file could disable security protection and then have access to the file system, or execute arbitrary commands.
- How it can be attacked
- Can be exploited remotely over the network with low attack complexity, needing no privileges and no user interaction. It has high impact on confidentiality, integrity and availability.
- Affected versions
- 9.00 through 9.50
- What to do
- Apply the vendor's security update for your release and restart the service. See the vendor advisory (opens in a new tab).
How to check if your Ghostscript is vulnerable
Find the exact version first, then compare it with the affected and fixed versions in each CVE above.
gs --version
On Linux, Debian, Ubuntu and RHEL-based distributions often backport security fixes and keep the old version number, so a package that looks old can already be patched. Check your distribution's own security tracker or the package changelog before concluding that a server is exposed.
Ghostscript security checklist
- Update through your distribution's package manager and restart services that load the library.
- Do not feed untrusted input to the tool without validation or sandboxing.
- Track where it is embedded in your software, since many applications bundle their own copy.
- Run processing jobs as an unprivileged user with limited resources.
Where you run Ghostscript matters as much as how you patch it. Whether your site lives on a VPS, a dedicated server or shared hosting (opens in a new tab), check who is responsible for updating Ghostscript: on most plans the operating system and applications are yours to patch unless the plan says otherwise.
Your stack is bigger than Ghostscript. A flaw anywhere in the chain can be the way in, so also review our guides to ImageMagick vulnerabilities, PHP vulnerabilities and FFmpeg vulnerabilities.
How to get alerted about new Ghostscript vulnerabilities
NVD received 0 new Ghostscript CVEs in the last twelve months, and critical ones can be exploited within days. Reading advisories by hand is easy to forget, so most teams automate it. You have three practical options:
- Follow the vendor's announcements and your distribution's security list. They are accurate but cover only one product and you read them manually.
- Query the NVD feed yourself. It is complete and needs scripting, filtering and a mail or chat integration to maintain.
- Use a stack-based alert service. You pick your technologies once and receive an email when a matching CVE appears.
Vulnario is the third option, and it is free to start. It scans the National Vulnerability Database, the CISA KEV catalog and GitHub Security Advisories every hour. You choose Ghostscript and the rest of your stack, confirm your email with a code, and the alerts begin. Each email includes the CVE number, the CVSS score, a marker when CISA lists the flaw as actively exploited, the attack vector, a patch or advisory link and a suggested time frame to fix it.
- Free: all technologies, alerts grouped at most every 12 hours.
- Pro ($29/month): alerts are sent on the next hourly scan, so you hear about a new CVE up to 12 hours earlier.
Related security guides
Few stacks run Ghostscript alone. These guides cover the technologies it is most often deployed with.
- ImageMagick vulnerabilities: ImageMagick is a widely used image processing library and toolkit.
- PHP vulnerabilities: PHP is the server-side language behind WordPress and most of the web.
- FFmpeg vulnerabilities: FFmpeg is the open-source framework for processing audio and video.
- curl vulnerabilities: curl and libcurl transfer data over HTTP and dozens of other protocols, and ship in almost every operating system.
- glibc vulnerabilities: glibc is the GNU C library that nearly every Linux program depends on.
- GNU Bash vulnerabilities: GNU Bash is the default shell on most Linux systems, known for the Shellshock bug.
- libxml2 vulnerabilities: libxml2 is the XML parsing library embedded in countless applications.
Frequently asked questions about Ghostscript vulnerabilities
What are the most critical Ghostscript vulnerabilities?
Based on NVD scores and CISA's exploited-vulnerability catalog, the most critical Ghostscript CVEs include CVE-2017-8291 (CVSS 7.8), CVE-2021-3781 (CVSS 9.9), CVE-2025-27831 (CVSS 9.8). The guide above ranks the 10 most critical with affected versions and fixes.
Have Ghostscript vulnerabilities been exploited in real attacks?
Yes. CISA's Known Exploited Vulnerabilities (KEV) catalog lists 1 Ghostscript CVE, including CVE-2017-8291. Treat these as the highest priority to patch.
How many vulnerabilities does Ghostscript have?
As of Nov 3, 2026 the National Vulnerability Database lists 139 CVEs for Ghostscript, with 12 rated critical by CVSS v3. 0 were published in the previous twelve months.
How do I check which Ghostscript version I run?
Run gs --version on the server and compare the result with the fixed versions in each CVE. On Debian, Ubuntu and RHEL-based systems, fixes are often backported without changing the version number, so also check your distribution's security tracker.
How can I get alerted when a new Ghostscript CVE is published?
Add Ghostscript to a service that watches the National Vulnerability Database, CISA KEV and GitHub Security Advisories. Vulnario does this for free: choose Ghostscript and the rest of your stack, verify your email, and you receive an alert when a new CVE matches. Free alerts are grouped at most every 12 hours, and Pro sends them on the next hourly scan.
Is Ghostscript secure?
Ghostscript is as secure as its patch level. NVD published 0 new Ghostscript CVEs in the last twelve months, so running a current, supported release and applying security updates promptly is the most effective protection.
What is CVE-2017-8291?
CVE-2017-8291 is a high Ghostscript vulnerability with a CVSS score of 7.8, published Apr 27, 2017. 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.
Sources
- National Vulnerability Database (NVD) (opens in a new tab), CVE records, CVSS scores and CPE counts, checked Nov 3, 2026.
- CISA Known Exploited Vulnerabilities (KEV) catalog (opens in a new tab), checked Nov 3, 2026.
This article is informational and not a substitute for your own risk assessment. CVSS scores and affected versions may change when NVD updates a record.