Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Queued live test to validate the change, test passed!
|
There was a problem hiding this comment.
Pull request overview
This PR hardens az aks check-acr against command injection and path/quoting issues by changing how kubectl version is invoked, aligning it with the safer kubectl run invocation style already used in the same function.
Changes:
- Replace a string-based
kubectl version ...shell command with an argv list (shell=False) to prevent command injection via temp-path interpolation. - Improve cross-platform correctness (notably Windows paths with spaces) by avoiding shell parsing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ab29784 to
4cc9175
Compare
az aks check-acr: Fix command injection via unquoted tempfile path in subprocess callaz aks check-acr: Fix command injection via unquoted tempfile path in subprocess call
|
I just updated the tile from |
Related command
az aks check-acrDescription
The
aks_check_acr()function constructs a shell command using an f-string that interpolatesbrowse_path(fromtempfile.mkstemp()) and passes it tosubprocess.Popen(..., shell=True). This is vulnerable to command injection whenTMPDIR/TMP/TEMPcontains shell metacharacters, and breaks on Windows when the user's path contains spaces (e.g.C:\Users\John Smith\...).Convert the string-based shell command to a safe argument list with
shell=False(the default), consistent with the existingkubectl runcall later in the same function.Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.