Improper Control of Generation of Code ('Code Injection') in Azure CLI
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-94.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Microsoft | azure-cli | before 2.40.0 | 2.40.0 | Patch available | CNA |
| — | azure-cli (PyPI) | before 2.40.0 | 2.40.0 | Patch available | GHSA-47xc-9rr2-q7p4 |
- azure-cli VendorMicrosoft Affected before 2.40.0 Fixed in 2.40.0 Patch available CNA
- azure-cli (PyPI) Vendor— Affected before 2.40.0 Fixed in 2.40.0 Patch available GHSA-47xc-9rr2-q7p4
Remediation
- Fix · CNA azure-cli (Azure) Fixed in 2.40.0
- Fix · GHSA-47xc-9rr2-q7p4 azure-cli (PyPI) Fixed in 2.40.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2022-39327
- 2026-10-03 Alias added: GHSA-47xc-9rr2-q7p4
- 2026-10-23 EPSS moved to the 90th–95th percentile
References
Exploit 2
More Microsoft Azure Command-line Interface vulnerabilities
- TI-2023-18102 Azure CLI REST Command Information Disclosure Vulnerability CVSS 3.1HIGH 8.6
- TI-2024-29220 Azure Command Line Integration (CLI) Elevation of Privilege Vulnerability CVSS 3.1CRITICAL 9.1
- TI-2025-17811 Azure Command Line Integration (CLI) Elevation of Privilege Vulnerability CVSS 3.1HIGH 8.4
Sources
- CVE-2022-39327 · CVE Program
- CVE-2022-39327 · NVD
- FIRST EPSS
- GHSA-47xc-9rr2-q7p4 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences