🔒 Security fix: prevent command injection in PlatformShellService#30
🔒 Security fix: prevent command injection in PlatformShellService#30google-labs-jules[bot] wants to merge 5 commits into
Conversation
🎯 **What:** The vulnerability fixed was a potential Command Injection in PlatformShellService due to unescaped arguments passed to `Process.Start()` when handling `open` or `xdg-open` commands on OSX and Linux respectively.⚠️ **Risk:** If a malicious path containing shell metacharacters or flags was passed to these methods, it could lead to arbitrary command execution with the privileges of the application. 🛡️ **Solution:** Used `ProcessStartInfo` with `UseShellExecute = false` and `ArgumentList` to safely pass the path argument without shell expansion. Additionally, prepended `./` to paths starting with `-` to prevent argument injection flags.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
🎯 **What:** The vulnerability fixed was a potential Command Injection in PlatformShellService due to unescaped arguments passed to `Process.Start()` when handling `open` or `xdg-open` commands on OSX and Linux respectively.⚠️ **Risk:** If a malicious path containing shell metacharacters or flags was passed to these methods, it could lead to arbitrary command execution with the privileges of the application. 🛡️ **Solution:** Used `ProcessStartInfo` with `UseShellExecute = false` and `ArgumentList` to safely pass the path argument without shell expansion. Additionally, prepended `./` to paths starting with `-` to prevent argument injection flags.
🎯 **What:** The vulnerability fixed was a potential Command Injection in PlatformShellService due to unescaped arguments passed to `Process.Start()` when handling `open` or `xdg-open` commands on OSX and Linux respectively.⚠️ **Risk:** If a malicious path containing shell metacharacters or flags was passed to these methods, it could lead to arbitrary command execution with the privileges of the application. 🛡️ **Solution:** Used `ProcessStartInfo` with `UseShellExecute = false` and `ArgumentList` to safely pass the path argument without shell expansion. Additionally, prepended `./` to paths starting with `-` to prevent argument injection flags.
🎯 **What:** The vulnerability fixed was a potential Command Injection in PlatformShellService due to unescaped arguments passed to `Process.Start()` when handling `open` or `xdg-open` commands on OSX and Linux respectively.⚠️ **Risk:** If a malicious path containing shell metacharacters or flags was passed to these methods, it could lead to arbitrary command execution with the privileges of the application. 🛡️ **Solution:** Used `ProcessStartInfo` with `UseShellExecute = false` and `ArgumentList` to safely pass the path argument without shell expansion. Additionally, prepended `./` to paths starting with `-` to prevent argument injection flags.
|
The security issue is real and worth fixing, but this PR should not be merged in its current form. Please resubmit as a focused PlatformShellService change against the current src/SalmonEgg.Infrastructure.Desktop implementation. The new PR should avoid workflow/global.json/csproj/formatting churn, avoid unrelated converter/UI edits, and include tests around argument construction for paths/URIs that begin with '-' or contain shell metacharacters. Prefer ProcessStartInfo with ArgumentList so the target is passed as an argument rather than a shell-expanded string, while preserving the existing platform capability boundary. |
🎯 **What:** The vulnerability fixed was a potential Command Injection in PlatformShellService due to unescaped arguments passed to `Process.Start()` when handling `open` or `xdg-open` commands on OSX and Linux respectively.⚠️ **Risk:** If a malicious path containing shell metacharacters or flags was passed to these methods, it could lead to arbitrary command execution with the privileges of the application. 🛡️ **Solution:** Used `ProcessStartInfo` with `UseShellExecute = false` and `ArgumentList` to safely pass the path argument without shell expansion. Additionally, prepended `./` to paths starting with `-` to prevent argument injection flags.
🎯 What: The vulnerability fixed was a potential Command Injection in PlatformShellService due to unescaped arguments passed to
⚠️ Risk: If a malicious path containing shell metacharacters or flags was passed to these methods, it could lead to arbitrary command execution with the privileges of the application.
Process.Start()when handlingopenorxdg-opencommands on OSX and Linux respectively.🛡️ Solution: Used
ProcessStartInfowithUseShellExecute = falseandArgumentListto safely pass the path argument without shell expansion. Additionally, prepended./to paths starting with-to prevent argument injection flags.PR created automatically by Jules for task 15526915261680762051 started by @YoungSx