Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL/HIGH] Fix command injection in VS Code extension#92

Draft
raccioly wants to merge 1 commit intomainfrom
sentinel/fix-command-injection-13877094348091632134
Draft

πŸ›‘οΈ Sentinel: [CRITICAL/HIGH] Fix command injection in VS Code extension#92
raccioly wants to merge 1 commit intomainfrom
sentinel/fix-command-injection-13877094348091632134

Conversation

@raccioly
Copy link
Copy Markdown
Owner

@raccioly raccioly commented May 7, 2026

🚨 Severity: HIGH

πŸ’‘ Vulnerability: The VS Code extension used execSync to execute commands, passing the workspaceDir as a concatenated string. This creates a critical command injection vulnerability. If a user opened a workspace directory with a maliciously crafted name (e.g., containing shell metacharacters like ;, &&, or ||), those commands would be executed arbitrarily within the host environment.

🎯 Impact: Remote Code Execution (RCE) on the developer's machine if they are tricked into opening a workspace with a crafted directory name.

πŸ”§ Fix:

  1. Replaced execSync with execFileSync to avoid shell evaluation of paths.
  2. Implemented parseArgsStringToArgv to safely tokenize string arguments into an array respecting both single and double quotes without breaking existing commands.
  3. Passed arguments securely as an array to execFileSync.
  4. Correctly handled Windows execution of .cmd files by dynamically determining the binary name and including the shell option strictly for Windows compatibility.
  5. Marked the activation function correctly as async.

βœ… Verification:

  1. Verified syntax logic using node -c vscode-extension/extension.js.
  2. Verified unit tests continue to pass (pnpm test).
  3. Confirmed proper isolation of paths containing spaces via a scratchpad test.

PR created automatically by Jules for task 13877094348091632134 started by @raccioly

Co-authored-by: raccioly <63126795+raccioly@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

πŸ‘‹ 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.

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