Arbitrary Command Injection Affecting @ronomon/opened package, versions <1.5.2


Severity

Recommended
0.0
critical
0
10

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

Threat Intelligence

EPSS
0.22% (61st 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 Learn

Learn about Arbitrary Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-RONOMONOPENED-1296551
  • published25 May 2021
  • disclosed25 May 2021
  • creditFábio Freitas

Introduced: 25 May 2021

CVE-2021-29300  (opens in a new tab)
CWE-77  (opens in a new tab)

How to fix?

Upgrade @ronomon/opened to version 1.5.2 or higher.

Overview

@ronomon/opened is a Check if a file is open in another application on Windows, macOS and Linux.

Affected versions of this package are vulnerable to Arbitrary Command Injection. This allows a remote attacker to execute commands on the system if the library was used with untrusted input.

The root cause of the problem is line 87 in index.js, which takes potential untrusted input as part of a string executed as a command by child_process.exec(). While the arguments are escaped by, an attacker could still bypass this sanitization because child_process.exec() will also interpret the string as a shell command.

CVSS Scores

version 3.1