π‘οΈ Sentinel: [CRITICAL] Fix command injection vulnerability#242
π‘οΈ Sentinel: [CRITICAL] Fix command injection vulnerability#242raccioly wants to merge 1 commit into
Conversation
Replaces multiple instances of `execSync` with `execFileSync` across the CLI codebase to prevent command injection vulnerabilities due to shell interpolation. Replicates native shell capabilities natively in JavaScript where needed. 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: Found multiple instances across the CLI tools where
execSyncwas used, which allows shell interpolation and makes the application vulnerable to command injection if dynamic or user-controlled inputs are passed (e.g., thenameargument inisCliAvailableor inputs parsed directly into Git commands).π― Impact: Attackers could execute arbitrary shell commands via command injection if an input string is not thoroughly sanitized and contains shell metacharacters like
;,&&, or||.π§ Fix: Replaced
execSyncwithexecFileSyncinsetup.mjs,score.mjs,freshness.mjs,ensure-skills.mjs, andshared-git.mjs. Adjusted commands that rely on piping (| wc -l) or redirection (2>/dev/null) to use native JavaScript counting and child process configuration parameters (stdio: ['pipe', 'pipe', 'ignore']).β Verification: Ran the full automated test suite to ensure that command execution behavior operates correctly natively without regressions.
PR created automatically by Jules for task 515927768858953820 started by @raccioly