CVE-2022-39327: Improper Control of Generation of Code ('Code Injection') in Azure CLI
Vulnerability summary
CVE-2022-39327 is a critical (CVSS 9.8) Code Injection vulnerability in azure azure-cli. EPSS estimates a 4.17% chance of exploitation in the next 30 days, higher than 90.8% of scored vulnerabilities. 1 public exploit is recorded.
Timeline
- 25-10-2022PublishedVulnerability first disclosed.
- 22-04-2025Last modifiedVulnerability information updated.
Description
Azure CLI is the command-line interface for Microsoft Azure. In versions previous to 2.40.0, Azure CLI contains a vulnerability for potential code injection. Critical scenarios are where a hosting machine runs an Azure CLI command where parameter values have been provided by an external source. The vulnerability is only applicable when the Azure CLI command is run on a Windows machine and with any version of PowerShell and when the parameter value contains the `&` or `|` symbols. If any of these prerequisites are not met, this vulnerability is not applicable. Users should upgrade to version 2.40.0 or greater to receive a a mitigation for the vulnerability.
CVSS metrics
4 scores · 4 sources · 1 version- CVE.orgCNA8.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HDiffers
- OSV · PypiEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · UbuntuEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS trend
Probability
4.17%
Chance of exploitation in the next 30 days
Percentile
91%
Versus all other CVEs
30-day change
Increase +0.71 pp
From 3.47% on 22-09-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
1 foundAzure Cli
Maturity: poc
Weaknesses
CWE · root cause- CWE-94Improper Control of Generation of Code ('Code Injection')The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
- CWE-78Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
Affected systems
Azure1 product
- azure-cli< 2.40.0
Microsoft1 product
- azure_command-line_interface< 2.40.0
PyPI1 product
- azure-cli< 2.40.0
Ubuntu1 product
- azure-cliAll versions (No fix recorded)
4 vendors · 4 products
References
9 links- github.com/Azure/azure-cli/security/advisories/GHSA-47xc-9rr2-q7p4WEBAdvisoryEVIDENCEREPORTExploitMitigationThird Party Advisory
- github.com/Azure/azure-cliPACKAGE