Command Injection Affecting @azure/ms-rest-nodeauth package, versions <3.0.8


Severity

Recommended
0.0
high
0
10

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

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.04% (12th 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 Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-AZUREMSRESTNODEAUTH-1245464
  • published14 Apr 2021
  • disclosed14 Apr 2021
  • creditzhou, peng

Introduced: 14 Apr 2021

CVE-2021-28458  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade @azure/ms-rest-nodeauth to version 3.0.8 or higher.

Overview

@azure/ms-rest-nodeauth is an Azure Authentication library in node.js with type definitions.

Affected versions of this package are vulnerable to Command Injection via the child_process function execAz(). This function can be injected with arbitrary OS commands. Attackers can exploit this vulnerability by calling AzureCliCredentials.setDefaultSubscription (OS command) from the Azure CLI.

PoC

auth = require('@azure/ms-rest-nodeauth');
auth.AzureCliCredentials.setDefaultSubscription('$(touch pzhou@shu)');

CVSS Scores

version 3.1