CVE-2021-3781 Command injection in ghostscript
Attackers can execute arbitrary commands via crafted documents in Ghostscript when the safer sandbox mode is enabled.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-3781?
CVE-2021-3781 is a critical command injection vulnerability in Artifex Ghostscript, published on 16 Feb 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Official 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.
Which versions are affected by CVE-2021-3781?
It affects 2 products.
Linux distribution packages (40)
ghostscript SUSE:Enterprise Storage 6 | All versions | 9.52-155.1 |
libspectre SUSE:Enterprise Storage 6 | All versions | 0.2.8-3.12.1 |
ghostscript SUSE:HPE Helion OpenStack 8 | All versions | 9.52-23.42.1 |
libspectre SUSE:HPE Helion OpenStack 8 | All versions | 0.2.7-12.12.1 |
ghostscript SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 9.52-155.1 |
libspectre SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 0.2.8-3.12.1 |
ghostscript SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 9.52-155.1 |
libspectre SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 0.2.8-3.12.1 |
ghostscript SUSE:Linux Enterprise High Performance Computing 15-ESPOS | All versions | 9.52-155.1 |
libspectre SUSE:Linux Enterprise High Performance Computing 15-ESPOS | All versions | 0.2.8-3.12.1 |
ghostscript SUSE:Linux Enterprise High Performance Computing 15-LTSS | All versions | 9.52-155.1 |
libspectre SUSE:Linux Enterprise High Performance Computing 15-LTSS | All versions | 0.2.8-3.12.1 |
ghostscript SUSE:Linux Enterprise Module for Basesystem 15 SP2 | All versions | 9.52-155.1 |
ghostscript SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 9.52-155.1 |
libspectre SUSE:Linux Enterprise Module for Desktop Applications 15 SP2 | All versions | 0.2.8-3.12.1 |
libspectre SUSE:Linux Enterprise Module for Desktop Applications 15 SP3 | All versions | 0.2.8-3.12.1 |
ghostscript SUSE:Linux Enterprise Server 12 SP2-BCL | All versions | 9.52-23.42.1 |
libspectre SUSE:Linux Enterprise Server 12 SP2-BCL | All versions | 0.2.7-12.12.1 |
ghostscript SUSE:Linux Enterprise Server 12 SP3-BCL | All versions | 9.52-23.42.1 |
libspectre SUSE:Linux Enterprise Server 12 SP3-BCL | All versions | 0.2.7-12.12.1 |
ghostscript SUSE:Linux Enterprise Server 12 SP3-LTSS | All versions | 9.52-23.42.1 |
libspectre SUSE:Linux Enterprise Server 12 SP3-LTSS | All versions | 0.2.7-12.12.1 |
ghostscript SUSE:Linux Enterprise Server 12 SP4-LTSS | All versions | 9.52-23.42.1 |
libspectre SUSE:Linux Enterprise Server 12 SP4-LTSS | All versions | 0.2.7-12.12.1 |
ghostscript SUSE:Linux Enterprise Server 12 SP5 | All versions | 9.52-23.42.1 |
libspectre SUSE:Linux Enterprise Server 12 SP5 | All versions | 0.2.7-12.12.1 |
ghostscript SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 9.52-155.1 |
libspectre SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 0.2.8-3.12.1 |
ghostscript SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 9.52-155.1 |
libspectre SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 0.2.8-3.12.1 |
ghostscript SUSE:Linux Enterprise Server 15-LTSS | All versions | 9.52-155.1 |
libspectre SUSE:Linux Enterprise Server 15-LTSS | All versions | 0.2.8-3.12.1 |
ghostscript SUSE:Linux Enterprise Server for SAP Applications 12 SP3 | All versions | 9.52-23.42.1 |
libspectre SUSE:Linux Enterprise Server for SAP Applications 12 SP3 | All versions | 0.2.7-12.12.1 |
ghostscript SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | All versions | 9.52-23.42.1 |
libspectre SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | All versions | 0.2.7-12.12.1 |
ghostscript SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 9.52-23.42.1 |
libspectre SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 0.2.7-12.12.1 |
ghostscript SUSE:Linux Enterprise Server for SAP Applications 15 | All versions | 9.52-155.1 |
libspectre SUSE:Linux Enterprise Server for SAP Applications 15 | All versions | 0.2.8-3.12.1 |
Products include Artifex Ghostscript, Fedoraproject Fedora.
How do I fix CVE-2021-3781?
Apply the vendor's patch.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2021-3781 being exploited?
There is no known exploitation of CVE-2021-3781 in the wild and no public exploit code.
Other vulnerabilities in Artifex Ghostscript
Sources
Also known as ALPINE-CVE-2021-3781, DEBIAN-CVE-2021-3781, DSA-4972-1, GHSA-gf7q-r6ff-xwg6, MGASA-2021-0436, OESA-2022-1560 and 6 more.