π‘οΈ Sentinel: [CRITICAL/HIGH] Fix command injection in VS Code extension#92
π‘οΈ Sentinel: [CRITICAL/HIGH] Fix command injection in VS Code extension#92
Conversation
Co-authored-by: raccioly <63126795+raccioly@users.noreply.github.com>
|
π 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. |
π¨ Severity: HIGH
π‘ Vulnerability: The VS Code extension used
execSyncto execute commands, passing theworkspaceDiras 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:
execSyncwithexecFileSyncto avoid shell evaluation of paths.parseArgsStringToArgvto safely tokenize string arguments into an array respecting both single and double quotes without breaking existing commands.execFileSync..cmdfiles by dynamically determining the binary name and including theshelloption strictly for Windows compatibility.β Verification:
node -c vscode-extension/extension.js.pnpm test).PR created automatically by Jules for task 13877094348091632134 started by @raccioly