Arbitrary Command Injection Affecting whereis package, versions <0.4.1


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
2.76% (86th 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 IDnpm:whereis:20180401
  • published2 Apr 2018
  • disclosed1 Apr 2018
  • creditChALkeR

Introduced: 1 Apr 2018

CVE-2018-3772  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade whereis to version 0.4.1 or higher.

Overview

whereis is a tool to get the first path to a bin on any system.

Affected versions of this package are vulnerable to Arbitrary Command Injection. It concatenates unsanitized user input into exec() command

PoC by ChALkeR

var whereis = require('whereis');
var filename = 'wget; touch /tmp/tada';
whereis(filename, function(err, path) {
  console.log(path);
});

Observe file /tmp/tada created.

CVSS Base Scores

version 3.1