Skip to content

🔒 Security fix: prevent command injection in PlatformShellService#30

Open
google-labs-jules[bot] wants to merge 5 commits into
mainfrom
security/fix-command-injection-15526915261680762051
Open

🔒 Security fix: prevent command injection in PlatformShellService#30
google-labs-jules[bot] wants to merge 5 commits into
mainfrom
security/fix-command-injection-15526915261680762051

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

🎯 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.


PR created automatically by Jules for task 15526915261680762051 started by @YoungSx

🎯 **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.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented May 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
salmonegg Error Error Jun 25, 2026 1:38pm

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@YoungSx

YoungSx commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant