CVE-2021-3781
CriticalA trivial sandbox (enabled with the -dSAFER option) escape flaw was found in the ghostscript interpreter by injecting a specially crafted pipe command.
Published Feb 16, 2022 · Updated Aug 4, 2026 · Also known as ALPINE-CVE-2021-3781, DEBIAN-CVE-2021-3781, DSA-4972-1, SUSE-SU-2021:3044-1, SUSE-SU-2021:3180-1, UBUNTU-CVE-2021-3781, USN-5075-1
Key Facts
Patch immediately- CVE-2021-3781 is a critical-severity vulnerability (CVSS 9.9 v3.1) affecting Ghostscript (Artifex), Fedora (Fedoraproject), rootio-ghostscript and 7 more products.
- It is not listed in any known-exploited vulnerabilities catalog. No public exploit code is known.
- EPSS estimates a 84% probability of exploitation in the next 30 days.
- Fixed versions are available, including Ghostscript 9.50~dfsg-5ubuntu4.3, Ghostscript 9.52-155.1, Ghostscript 9.52-23.42.1.
- Brandefense priority: patch immediately, because it is very likely to be exploited soon.
CVSS v3.1
9.9
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
EPSS (30-day exploit likelihood)
84%
Higher than 99.6% of all scored CVEs
Exploited in the wild
No known
Not in a known-exploited catalog
Public exploit code
None known
Get the full CVE-2021-3781 brief as a PDF
Every affected product and fixed release, exploitation status and a first 24 hours response checklist, emailed within minutes.
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.
Affected Products
253 affected entries in total| Product | Affected versions | Fixed in |
|---|---|---|
| GhostscriptArtifex | 9.50, 9.52, 9.53.3, 9.54.0, >= ghostpdl 9.55.0 | 9.54.0-3 |
| FedoraFedoraproject | 34 | n/a |
| rootio-ghostscriptrootio | See advisory | 9.54-r1 |
| ghostscript-develsuse | See advisory | 9.52-23.42.1 |
| ghostscript-mini-develsuse | See advisory | 9.52-lp152.2.7.1 |
Patched Releases
Ghostscript
9.50~dfsg-5ubuntu4.3, 9.52-155.1, 9.52-23.42.1, 9.52-lp152.2.7.1, 9.53.3-r1, 9.53.3~dfsg-7+deb11u1, 9.53.3~dfsg-8, 9.54-r1, 9.54.0-2.2, 9.54.0-3, 9.54.0-r2, 9.54.0~dfsg1-0ubuntu2
ghostscript-devel
9.52-155.1, 9.52-23.42.1, 9.52-lp152.2.7.1, 9.54.0-2.2
ghostscript-mini
9.52-lp152.2.7.1
ghostscript-mini-devel
9.52-lp152.2.7.1
ghostscript-x11
9.52-155.1, 9.52-23.42.1, 9.52-lp152.2.7.1, 9.54.0-2.2
libspectre
0.2.7-12.12.1, 0.2.8-3.12.1
libspectre-devel
0.2.7-12.12.1, 0.2.8-3.12.1, 0.2.8-lp152.4.3.1
libspectre1
0.2.7-12.12.1, 0.2.8-3.12.1, 0.2.8-lp152.4.3.1
rootio-ghostscript
9.53.3~dfsg-8, 9.54-r1
Timeline
Publicly disclosed
Feb 16, 2022
Last updated
Aug 4, 2026
Weakness Type
- CWE-20 Improper Input Validation
- CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
References
- advisoryhttps://bugzilla.suse.com/1184123
- advisoryhttps://bugzilla.suse.com/1190381
- advisoryhttps://security.alpinelinux.org/vuln/CVE-2021-3781
- advisoryGLSA-202211-11
- advisoryhttps://security-tracker.debian.org/tracker/CVE-2021-3781
FAQ
Common Questions.
A trivial sandbox (enabled with the -dSAFER option) escape flaw was found in the ghostscript interpreter by injecting a specially crafted pipe command.
Affected: Ghostscript (Artifex) versions 9.50, 9.52, 9.53.3, 9.54.0, >= ghostpdl 9.55.0; Fedora (Fedoraproject) versions 34; rootio-ghostscript, among others. The full list is in the CVE brief.
It is not listed in any known-exploited vulnerabilities catalog.
No, it is not currently listed in the CISA Known Exploited Vulnerabilities catalog.
No public exploit code is known.
Fixed versions are available, including Ghostscript 9.50~dfsg-5ubuntu4.3, Ghostscript 9.52-155.1, Ghostscript 9.52-23.42.1.
Brandefense priority: patch immediately, because it is very likely to be exploited soon.
Is CVE-2021-3781 Running On Your Attack Surface?
Brandefense maps vulnerabilities like this one to your internet-facing assets and tells you exactly where to patch.
Request A Demo