Arbitrary Command Execution Affecting @knutkirkhorn/free-space package, versions <1.3.0


Severity

Recommended
0.0
medium
0
10

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

Threat Intelligence

Exploit Maturity
Proof of concept

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 Learn

Learn about Arbitrary Command Execution vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-KNUTKIRKHORNFREESPACE-1009833
  • published18 Sept 2020
  • disclosed18 Sept 2020
  • creditansuj

Introduced: 18 Sep 2020

CVE NOT AVAILABLE CWE-77  (opens in a new tab)

How to fix?

Upgrade @knutkirkhorn/free-space to version 1.3.0 or higher.

Overview

@knutkirkhorn/free-space is a package that gets the amount of free space for a drive.

Affected versions of this package are vulnerable to Arbitrary Command Execution due to the lack of sanitization of the input parameter of the library's exported anonymous function. The exported function, when given a parameter checks what platform the code is being run on and sends that parameter to a function call in either lib/unix.js or lib/windows/js. The vulnerability exists in lib/unix.js which directly uses the user-input parameter: disk in the template string that ultimately gets executed.

References

CVSS Scores

version 3.1