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


0.0
high

Snyk CVSS

    Attack Complexity Low
    Confidentiality High
    Integrity High
    Availability High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.04% (9th percentile)
Expand this section
NVD
7.8 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 SNYK-JS-AZUREMSRESTNODEAUTH-1245464
  • published 14 Apr 2021
  • disclosed 14 Apr 2021
  • credit zhou, peng

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)');