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: CRITICAL
π‘ Vulnerability: The VS Code extension used
execSync(cmd, { cwd: workspaceDir })to executespecguardcommands. It dynamically generated thecmdstring using untrusted folder paths (viaworkspaceDir) 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
execSpecguardto useexecFileSyncinstead ofexecSync. Implemented aparseArgstokenization function to process arguments properly. Instead of relying on wrapper scripts (.cmd) which requireshell: trueto execute on Windows (thus re-introducing RCE risks), the fix resolves the actual underlying JavaScript file (node_modules/specguard/cli/docguard.mjs) and calls thenodebinary directly. Theactivatecommand signature was updated toasync.β Verification: Ran
pnpm testand 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 vianode -c vscode-extension/extension.js.PR created automatically by Jules for task 13179415427409074010 started by @raccioly