CVE-2022-39327: Code Injection Vulnerability in Azure CLI
Summary
CVE-2022-39327: Improper Control of Generation of Code ('Code Injection') in Azure CLI. Affects azure-cli versions < 2.40.0. Fixed in 2.40.0. How to fix ↓
Also tracked for
The same CVE-2022-39327 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Azure CLI is the command-line interface for Microsoft Azure, providing users with a convenient way to interact with Azure services. It allows users to manage resources, deploy applications, and automate tasks. The vulnerability in Azure CLI versions prior to 2.40.0 exposes a potential code injection issue. This vulnerability specifically affects Windows machines running Azure CLI commands with parameter values provided by an external source. It is important to note that this vulnerability is only applicable when PowerShell is used and the parameter value contains the & or | symbols. Upgrading to version 2.40.0 or later is recommended to mitigate this vulnerability.
Vulnerability Detail
The code injection vulnerability in Azure CLI arises when a hosting machine runs an Azure CLI command with parameter values from an external source. This vulnerability is only applicable on Windows machines using any version of PowerShell, and when the parameter value contains the & or | symbols. In such scenarios, an attacker can potentially inject malicious code into the command, leading to unauthorized access, data breaches, or other malicious activities. It is crucial to upgrade to Azure CLI version 2.40.0 or higher to address this vulnerability.
How To Fix
Minimum fixed version
2.40.0
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no specific workaround available for this vulnerability. It is recommended to upgrade to Azure CLI version 2.40.0 or later as soon as possible to address the code injection vulnerability.
Conclusion
The code injection vulnerability in Azure CLI versions prior to 2.40.0 poses a significant security risk for Windows machines running Azure CLI commands with parameter values from external sources. Upgrading to version 2.40.0 or later is crucial to mitigate this vulnerability and ensure the security of Azure CLI commands. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for azure-cli →
FAQ
Azure CLI is the command-line interface for Microsoft Azure, allowing users to manage Azure resources, deploy applications, and automate tasks.
Versions of Azure CLI prior to 2.40.0 are affected by this code injection vulnerability.
This vulnerability is only applicable on Windows machines running Azure CLI commands with parameter values provided by an external source. It requires the use of PowerShell and the parameter value must contain the & or | symbols.
The code injection vulnerability in Azure CLI can lead to unauthorized access, data breaches, or other malicious activities, depending on the injected code.
You can use Vulert's playground at Vulert Scanner to check if your Azure CLI installation is affected by this vulnerability. Simply upload your package-lock.json file and Vulert will provide real-time monitoring and alerts for open-source vulnerabilities.
References
Related vulnerabilities
Recent vulnerabilities recorded for azure-cli.