Skip to content

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

Draft
raccioly wants to merge 1 commit intomainfrom
sentinel-fix-vscode-extension-command-injection-13179415427409074010
Draft

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

Conversation

@raccioly
Copy link
Copy Markdown
Owner

@raccioly raccioly commented May 8, 2026

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: The VS Code extension used execSync(cmd, { cwd: workspaceDir }) to execute specguard commands. It dynamically generated the cmd string using untrusted folder paths (via workspaceDir) and string-interpolated arguments. This creates a critical Remote Code Execution (RCE) vulnerability because an attacker could craft a malicious folder name with shell operators (like ;, &&, or ||) to execute arbitrary commands when the user opens the project in VS Code.
🎯 Impact: Opening a maliciously crafted project in VS Code would result in immediate Remote Code Execution (RCE) without user interaction, leading to complete system compromise.
πŸ”§ Fix: Refactored execSpecguard to use execFileSync instead of execSync. Implemented a parseArgs tokenization function to process arguments properly. Instead of relying on wrapper scripts (.cmd) which require shell: true to execute on Windows (thus re-introducing RCE risks), the fix resolves the actual underlying JavaScript file (node_modules/specguard/cli/docguard.mjs) and calls the node binary directly. The activate command signature was updated to async.
βœ… Verification: Ran pnpm test and passed all 61 tests without regressions. Simulated Windows resolution code to ensure Node scripts will properly execute directly via the engine. Ensure syntax is valid via node -c vscode-extension/extension.js.


PR created automatically by Jules for task 13179415427409074010 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