π‘οΈ Sentinel: [HIGH] Fix command injection vulnerability in tool existence check#68
π‘οΈ Sentinel: [HIGH] Fix command injection vulnerability in tool existence check#68
Conversation
Replaced `shell("/usr/bin/which \(tool)")` wrapper with direct execution
using `Process` and explicitly mapped arguments to prevent potential
command injection from string interpolation.
Co-authored-by: acebytes <2820910+acebytes@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: Command injection vulnerability in
toolExistsvia unsafe string interpolation in a shell wrapper (shell("/usr/bin/which \(tool)")). Whiletoolvariables currently come from hardcodedrequiresToolproperties, this unsafe pattern risks severe arbitrary command execution if those strings ever become dynamically sourced (e.g. from user config or server).π― Impact: Arbitrary command execution with user privileges.
π§ Fix: Replaced the
shellfunction wrapper with direct execution of/usr/bin/whichusingProcess(), passing thetoolvariable explicitly as an element in theargumentsarray instead of via string interpolation.β Verification: Review the updated
toolExistsfunction inSources/Cacheout/Models/CacheCategory.swiftto ensure direct invocation without/bin/bashor string interpolation.PR created automatically by Jules for task 11857720161025045232 started by @acebytes