-
Notifications
You must be signed in to change notification settings - Fork 3.4k
{Core} Fix potential command injection #32885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -804,7 +804,7 @@ def open_page_in_browser(url): | |
| # https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_powershell_exe | ||
| # Ampersand (&) should be quoted | ||
| return subprocess.Popen( | ||
| ['powershell.exe', '-NoProfile', '-Command', 'Start-Process "{}"'.format(url)]).wait() | ||
| ['powershell.exe', '-NoProfile', '-Command', 'Start-Process', url]).wait() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ran this as a script & it looks like the pwsh script actually executes which is embedded in the url. MALICIOUS_URL = 'https://example.com/$(Write-Output INJECTED)' With Current code: With Your PR changes: With my fix: |
||
| except OSError: # WSL might be too old # FileNotFoundError introduced in Python 3 | ||
| pass | ||
| elif platform_name == 'darwin': | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.