Arbitrary Command Injection Affecting whereis package, versions <0.4.1


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.29% (70th 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 ID npm:whereis:20180401
  • published 2 Apr 2018
  • disclosed 1 Apr 2018
  • credit ChALkeR

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 Scores

version 3.1
Expand this section

Snyk

9.9 critical
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    None
  • Scope (S)
    Changed
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    High