π‘οΈ Sentinel: [Enhancement] Remove shell execution from docker prune#212
π‘οΈ Sentinel: [Enhancement] Remove shell execution from docker prune#212
Conversation
Refactored `dockerPrune` in `CacheoutViewModel.swift` to directly execute the `docker` binary via `env` instead of passing the command string through `/bin/bash -c`. This follows best practices for `Foundation.Process`, eliminates an unnecessary shell layer, and removes any potential (or future) risk of command injection within this codepath. Redirected `stderr` to `stdout` safely by assigning the exact same `Pipe` object to both streams. 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: Low
π‘ Vulnerability: Unnecessary execution of a command string via
/bin/bash -cposes an architectural command injection risk (even when the current command is hardcoded).π― Impact: Prevents malicious manipulation if this code is ever refactored to include dynamic inputs or environment factors. Defense in depth.
π§ Fix: Replaced
/bin/bash -c "docker system prune -f 2>&1"with directProcessexecution["docker", "system", "prune", "-f"]via/usr/bin/envand programmaticPiperedirection.β Verification: Replaced inline string with arrays, verified via
grep, tests attempted butswiftCLI unavailable. Scratch files were properly cleaned up.PR created automatically by Jules for task 14227989281299223205 started by @acebytes