Vulnerabilities / CVE-2021-3781

critical

CVE-2021-3781

ghostscript: sandbox escape using '%pipe%'

Published Modified CWE 20, 78
In the Trivy database since at least 24 Oct 2026, 07:11 UTCWhen it arrived before that build is not recorded.

Severity by source

NVD9.9CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Red Hat9.8CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Trivy's own label is CRITICAL. Rated critical by NVD. Rated lower by Red Hat (high), Ubuntu (high).

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 packages and fixed versions

SourcePackageFixed in
alpine 3.13ghostscript9.53.3-r1
alpine 3.14ghostscript9.54-r1
alpine 3.15ghostscript9.54-r1
alpine 3.16ghostscript9.54-r1
alpine 3.17ghostscript9.54-r1
alpine 3.18ghostscript9.54-r1
alpine 3.19ghostscript9.54-r1
alpine 3.20ghostscript9.54-r1
alpine 3.21ghostscript9.54-r1
alpine 3.22ghostscript9.54-r1
alpine 3.23ghostscript9.54-r1
alpine 3.24ghostscript9.54-r1
Show all 25 entries from 25 sources
SourcePackageFixed in
alpine 3.13ghostscript9.53.3-r1
alpine 3.14ghostscript9.54-r1
alpine 3.15ghostscript9.54-r1
alpine 3.16ghostscript9.54-r1
alpine 3.17ghostscript9.54-r1
alpine 3.18ghostscript9.54-r1
alpine 3.19ghostscript9.54-r1
alpine 3.20ghostscript9.54-r1
alpine 3.21ghostscript9.54-r1
alpine 3.22ghostscript9.54-r1
alpine 3.23ghostscript9.54-r1
alpine 3.24ghostscript9.54-r1
alpine edgeghostscript9.54-r1
debian 11ghostscript9.53.3~dfsg-7+deb11u1
debian 12ghostscript9.53.3~dfsg-8
debian 13ghostscript9.53.3~dfsg-8
debian 14ghostscript9.53.3~dfsg-8
echoghostscript9.53.3~dfsg-8
root.io alpine 3.17rootio-ghostscript9.54-r1
root.io debian 12rootio-ghostscript9.53.3~dfsg-8
ubuntu 20.04ghostscript9.50~dfsg-5ubuntu4.3
ubuntu 20.04-ESMghostscript9.50~dfsg-5ubuntu4.3
ubuntu 21.04ghostscript9.53.3~dfsg-7ubuntu0.1
ubuntu 21.10ghostscript9.54.0~dfsg1-0ubuntu2
ubuntu 22.04ghostscript9.54.0~dfsg1-0ubuntu2

References

Vulnerability data compiled from the Trivy vulnerability database (trivy-db, Aqua Security, Apache License 2.0), which aggregates third-party advisories. CVE records are published by The MITRE Corporation under the CVE Terms of Use; CVE is a trademark of MITRE. This product uses data from the NVD API but is not endorsed or certified by the NVD. Severity, titles and advisory data from the GitHub Advisory Database (CC BY 4.0), Red Hat security data (CC BY 4.0) and the other sources linked on each entry. Entries may be summarised or re-formatted; the linked original is the authoritative record.