Command Injection

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

Report new vulnerabilities
Do your applications use this vulnerable package? Test your applications

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

Remediation

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

References

CVSS Score

7.8
high severity
  • Attack Vector
    Local
  • Attack Complexity
    Low
  • Privileges Required
    Low
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    High
  • Availability
    High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:P
Credit
zhou, peng
CVE
CVE-2021-28458
CWE
CWE-78
Snyk ID
SNYK-JS-AZUREMSRESTNODEAUTH-1245464
Disclosed
14 Apr, 2021
Published
14 Apr, 2021