Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
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>
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
Pull request overview
This PR updates the WSL-specific browser-launching logic in azure-cli-core to mitigate potential command injection when invoking powershell.exe from open_page_in_browser.
Changes:
- Adjusts the
powershell.exe -Command Start-Process ...invocation to avoid interpolating the URL into a single command string.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
notyashhh
left a comment
There was a problem hiding this comment.
I think this will not work because for example:
Start-Process "https://x.com/$(whoami)"
will evaluate to $(whoami)
I believe we should do
safe_url = url.replace("'", "''")
return subprocess.Popen(
['powershell.exe', '-NoProfile', '-Command', "Start-Process'{}'".format(safe_url)]).wait()
)
When user's input url is I.e, it won't recognize double quotation marks as a type of PowerShell syntax. |
Related command
Description
IcM: https://portal.microsofticm.com/imp/v5/incidents/details/31000000548908/summary
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.