# CVE-2021-3781: ghostscript: A trivial sandbox (enabled with the `-dSAFER` option) escape flaw was found in the ghostscript interpreter by injecti...

CVE-2021-3781 is fixed in 4 products on 1 platform, first by ghostscript 9.50~dfsg-5ubuntu4.3, released September 7, 2021. It is not reported as exploited. Patch Radar priority: Urgent.

- Web page: https://patchblox.com/security/cve/CVE-2021-3781
- Priority: Urgent
- CVSS: 9.9 (critical)
- EPSS: 0.8391
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Sep 7, 2021

## Description

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.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | ghostscript Debian 12.15 (bookworm) | 9.53.3~dfsg-8 | [DEBIAN-CVE-2021-3781](https://patchblox.com/security/data/fix/linux/debian-cve-2021-3781.md) | Feb 16, 2022 |
| Linux | ghostscript Debian 13.5 (trixie) | 9.53.3~dfsg-8 | [DEBIAN-CVE-2021-3781](https://patchblox.com/security/data/fix/linux/debian-cve-2021-3781.md) | Feb 16, 2022 |
| Linux | ghostscript Debian 14 | 9.53.3~dfsg-8 | [DEBIAN-CVE-2021-3781](https://patchblox.com/security/data/fix/linux/debian-cve-2021-3781.md) | Feb 16, 2022 |
| Linux | ghostscript Ubuntu 20.04 LTS (focal) | 9.50~dfsg-5ubuntu4.3 | [ghostscript 9.50~dfsg-5ubuntu4.3](https://patchblox.com/security/data/fix/linux/ubuntu-focal-ghostscript-9.50-dfsg-5ubuntu4.3.md) | Sep 7, 2021 |
| Linux | ghostscript Ubuntu 22.04.1 LTS (jammy) | 9.54.0~dfsg1-0ubuntu2 | [ghostscript 9.54.0~dfsg1-0ubuntu2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-ghostscript-9.54.0-dfsg1-0ubuntu2.md) | Sep 7, 2021 |
| Linux | ghostscript-x Ubuntu 20.04 LTS (focal) | 9.50~dfsg-5ubuntu4.3 | [ghostscript-x 9.50~dfsg-5ubuntu4.3](https://patchblox.com/security/data/fix/linux/ubuntu-focal-ghostscript-x-9.50-dfsg-5ubuntu4.3.md) | Sep 7, 2021 |
| Linux | ghostscript-x Ubuntu 22.04.1 LTS (jammy) | 9.54.0~dfsg1-0ubuntu2 | [ghostscript-x 9.54.0~dfsg1-0ubuntu2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-ghostscript-x-9.54.0-dfsg1-0ubuntu2.md) | Sep 7, 2021 |
| Linux | libgs9 Ubuntu 20.04 LTS (focal) | 9.50~dfsg-5ubuntu4.3 | [libgs9 9.50~dfsg-5ubuntu4.3](https://patchblox.com/security/data/fix/linux/ubuntu-focal-libgs9-9.50-dfsg-5ubuntu4.3.md) | Sep 7, 2021 |
| Linux | libgs9 Ubuntu 22.04.1 LTS (jammy) | 9.54.0~dfsg1-0ubuntu2 | [libgs9 9.54.0~dfsg1-0ubuntu2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-libgs9-9.54.0-dfsg1-0ubuntu2.md) | Sep 7, 2021 |
| Linux | libgs9-common Ubuntu 20.04 LTS (focal) | 9.50~dfsg-5ubuntu4.3 | [libgs9-common 9.50~dfsg-5ubuntu4.3](https://patchblox.com/security/data/fix/linux/ubuntu-focal-libgs9-common-9.50-dfsg-5ubuntu4.3.md) | Sep 7, 2021 |
| Linux | libgs9-common Ubuntu 22.04.1 LTS (jammy) | 9.54.0~dfsg1-0ubuntu2 | [libgs9-common 9.54.0~dfsg1-0ubuntu2](https://patchblox.com/security/data/fix/linux/ubuntu-jammy-libgs9-common-9.54.0-dfsg1-0ubuntu2.md) | Sep 7, 2021 |

---

Data as of 2026-11-08T19:12:23Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
