# CVE-2023-43115: Command injection in n/a

> Attackers can achieve remote code execution by crafting PostScript documents that manipulate IJS device settings in Ghostscript.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 18 Sep 2023
- **Updated:** 2 Aug 2024
- **Also known as:** ALPINE-CVE-2023-43115, ALSA-2023:6265, ALSA-2023:6732, BELL-CVE-2023-43115, DEBIAN-CVE-2023-43115, GHSA-9p55-888j-qxrh, MGASA-2023-0290, OESA-2023-1695, OESA-2023-1696, RHSA-2023:5868, RHSA-2023:6265, RHSA-2023:6732, SUSE-SU-2023:3938-1, SUSE-SU-2023:3984-1, UBUNTU-CVE-2023-43115, USN-6433-1, openSUSE-SU-2024:13247-1, openSUSE-SU-2026:10855-1

## What is CVE-2023-43115?

CVE-2023-43115 is a high-severity command injection vulnerability in Artifex Ghostscript, published on 18 Sep 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

In Artifex Ghostscript through 10.01.2, gdevijs.c in GhostPDL can lead to remote code execution via crafted PostScript documents because they can switch to the IJS device, or change the IjsServer parameter, after SAFER has been activated. NOTE: it is a documented risk that the IJS server can be specified on a gs command line (the IJS device inherently must execute a command to start the IJS server).

## Which versions are affected by CVE-2023-43115?

It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ghostscript` | AlmaLinux:9 | All versions | 9.54.0-11.el9_2 |
| `ghostscript` | AlmaLinux:9 | All versions | 9.54.0-14.el9_3 |
| `ghostscript-doc` | AlmaLinux:9 | All versions | 9.54.0-11.el9_2 |
| `ghostscript-doc` | AlmaLinux:9 | All versions | 9.54.0-14.el9_3 |
| `ghostscript-tools-dvipdf` | AlmaLinux:9 | All versions | 9.54.0-11.el9_2 |
| `ghostscript-tools-dvipdf` | AlmaLinux:9 | All versions | 9.54.0-14.el9_3 |
| `ghostscript-tools-fonts` | AlmaLinux:9 | All versions | 9.54.0-11.el9_2 |
| `ghostscript-tools-fonts` | AlmaLinux:9 | All versions | 9.54.0-14.el9_3 |
| `ghostscript-tools-printing` | AlmaLinux:9 | All versions | 9.54.0-11.el9_2 |
| `ghostscript-tools-printing` | AlmaLinux:9 | All versions | 9.54.0-14.el9_3 |
| `ghostscript-x11` | AlmaLinux:9 | All versions | 9.54.0-11.el9_2 |
| `ghostscript-x11` | AlmaLinux:9 | All versions | 9.54.0-14.el9_3 |
| `libgs` | AlmaLinux:9 | All versions | 9.54.0-11.el9_2 |
| `libgs` | AlmaLinux:9 | All versions | 9.54.0-14.el9_3 |
| `libgs-devel` | AlmaLinux:9 | All versions | 9.54.0-11.el9_2 |
| `libgs-devel` | AlmaLinux:9 | All versions | 9.54.0-14.el9_3 |
| `ghostscript` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-11.el9_2 |
| `ghostscript` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-14.el9_3 |
| `ghostscript-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-11.el9_2 |
| `ghostscript-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-14.el9_3 |
| `ghostscript-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-11.el9_2 |
| `ghostscript-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-14.el9_3 |
| `ghostscript-doc` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-11.el9_2 |
| `ghostscript-doc` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-14.el9_3 |
| `ghostscript-gtk-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-11.el9_2 |
| `ghostscript-gtk-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-14.el9_3 |
| `ghostscript-tools-dvipdf` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-11.el9_2 |
| `ghostscript-tools-dvipdf` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-14.el9_3 |
| `ghostscript-tools-fonts` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-11.el9_2 |
| `ghostscript-tools-fonts` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-14.el9_3 |
| `ghostscript-tools-printing` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-11.el9_2 |
| `ghostscript-tools-printing` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-14.el9_3 |
| `ghostscript-x11` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-11.el9_2 |
| `ghostscript-x11` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-14.el9_3 |
| `ghostscript-x11-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-11.el9_2 |
| `ghostscript-x11-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-14.el9_3 |
| `libgs` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-11.el9_2 |
| `libgs` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-14.el9_3 |
| `libgs-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-11.el9_2 |
| `libgs-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:9.54.0-14.el9_3 |

Products: Artifex Ghostscript, Fedoraproject Fedora.

## How do I fix CVE-2023-43115?

Apply the vendor's patch.

## Is CVE-2023-43115 being exploited?

There is no known exploitation of CVE-2023-43115 in the wild and no public exploit code.

Public exploit code:

- A small write-up with examples to understand CVE-2023-43115 (github_poc): https://github.com/jostaub/ghostscript-CVE-2023-43115

## Other vulnerabilities in Artifex Ghostscript

- [CVE-2017-8291](https://insights.sbomify.com/CVE-2017-8291/): Artifex Ghostscript Type Confusion (high 7.8, exploited in the wild)
- [CVE-2021-3781](https://insights.sbomify.com/CVE-2021-3781/): Command injection in ghostscript (critical 9.9)
- [CVE-2025-27831](https://insights.sbomify.com/CVE-2025-27831/): Memory corruption in n/a (critical 9.8)
- [CVE-2025-27832](https://insights.sbomify.com/CVE-2025-27832/): Memory corruption in n/a (critical 9.8)
- [CVE-2025-27836](https://insights.sbomify.com/CVE-2025-27836/): Memory corruption in n/a (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-43115 and fix it if it is affected.

What it is: CVE-2023-43115 is a high-severity command injection vulnerability in Artifex Ghostscript, published on 18 Sep 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2023-43115 in the wild and no public exploit code.

Affected product: Artifex Ghostscript. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-43115/ (Markdown: https://insights.sbomify.com/CVE-2023-43115/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-43115
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-43115
- OSV: https://osv.dev/vulnerability/CVE-2023-43115

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-43115/
Summaries are generated and may contain mistakes; the official description above is the record.
