Security: Remove unsafe PowerShell fallback in WSL#866
Security: Remove unsafe PowerShell fallback in WSL#866RinZ27 wants to merge 1 commit intoAzureAD:devfrom
Conversation
|
Hi @rayluo, Thank you for the feedback. I completely agree that preserving WSL support is essential to avoid a breaking change. I have updated the PR with a much more secure implementation:
All 52 tests passed successfully. Looking forward to your and @jiasli's review! |
|
@microsoft-github-policy-service agree |
|
My apologies, @rayluo! That was definitely not intentional. I was using some local environment scripts to help manage and format the changes, and it seems some of those internal tool notes and metadata accidentally leaked into the file during the push. I've just pushed a clean commit to restore |
|
Hi @rayluo, just checking in on this. I've already cleaned up the unintentional metadata noise from the previous push. The WSL fallback is now both secure (using PowerShell's All tests are passing. @jiasli, mind having a look for that second opinion when you have a moment? Thanks! |
3f653e0 to
fdda547
Compare
|
Just checking in on this one. I've addressed the feedback regarding the unintentional metadata and confirmed that the secure WSL fallback (using |
Problem
The previous implementation constructed a PowerShell command using string formatting with the
auth_uri. This pattern is susceptible to argument injection, potentially allowing arbitrary code execution if theauth_uriis controlled by an attacker.Solution
The vulnerable code block has been removed. The library now relies solely on Python's standard
webbrowsermodule, which handles URL opening safely and is the preferred method for cross-platform compatibility.