Skip to content
Emerging threatsCritical

CVE-2021-3781Ghostscript OS Command Injection

A 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 Nov 23, 2026 · Also known as ALPINE-CVE-2021-3781, CLEANSTART-2025-JH59626, DEBIAN-CVE-2021-3781, DSA-4972-1, JLSEC-2026-1464, MGASA-2021-0436, OESA-2022-1560, SUSE-SU-2021:3044-1, SUSE-SU-2021:3180-1, UBUNTU-CVE-2021-3781, USN-5075-1, openSUSE-SU-2021:1273-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 8 more products.
  • It is not listed in any known-exploited vulnerabilities catalog. No public exploit code is known.
  • EPSS estimates a 86% 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.

Scores

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)

86%

Higher than 99.7% of all scored CVEs

Exploit maturity

None known

ATLAS score

39/100

Publication score, see How it works

Exploitation Verdict

KEV listed

Not listed

Federal due date

None

No federal due date

Ransomware use

Not reported

Attributed actors

None named

Exploit & Defence Guidance

Exploit maturity

None known

Public exploit code

0

Proof-of-concept links

In-the-wild evidence

0

Reports of active use

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

263 affected entries in total
ProductAffected versionsFixed in
GhostscriptArtifex9.50, 9.52, 9.53.3, 9.54.0, >= ghostpdl 9.55.09.54.0-3
FedoraFedoraproject34n/a
rootio-ghostscriptrootioSee advisory9.54-r1
Ghostscript_jlljuliaSee advisory9.55.0+0
ghostscript-miniopensuseSee advisory9.52-lp152.2.7.1
6 more affected products in the full CVE brief

Patched Releases

Ghostscript

9.50~dfsg-5ubuntu4.3, 9.52-155.1, 9.52-23.42.1, 9.52-6.oe1, 9.52-7.oe1, 9.52-lp152.2.7.1, 9.53.3-2.1.mga8, 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_jll

9.55.0+0

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, 0.2.8-lp152.4.3.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

  1. Publicly disclosed

    Feb 16, 2022

  2. Last updated

    Nov 23, 2026

Weakness Type

  • CWE-20 Improper Input Validation
  • CWE-78 Improper Neutralization of Special Elements used in an OS Command

FAQ

Common Questions.

Is CVE-2021-3781 On Your Attack Surface?

Brandefense matches it against the products discovered on your perimeter and opens a finding the day a CVE like this is listed.

Request A Demo

Figures as of Dec 4, 2026. Compiled by Brandefense technologies from public vulnerability catalogs; scoring as described in How it works.

To report an error, contact Brandefense.