Information Exposure Affecting shescape package, versions >=1.4.0 <1.5.1


Severity

Recommended
0.0
low
0
10

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

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.14% (52nd 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-JS-SHESCAPE-2415029
  • published4 Mar 2022
  • disclosed3 Mar 2022
  • creditUnknown

Introduced: 3 Mar 2022

CVE-2022-24725  (opens in a new tab)
CWE-200  (opens in a new tab)

How to fix?

Upgrade shescape to version 1.5.1 or higher.

Overview

shescape is a simple shell escape library

Affected versions of this package are vulnerable to Information Exposure due to possible exposure of the home directory.

PoC

const cp = require("child_process");
const shescape = require("shescape");

const payload = "home_directory=~";
const options = { interpolation: true };
console.log(cp.execSync(`echo ${shescape.escape(payload, options)}`));
// home_directory=/home/user

CVSS Scores

version 3.1