π‘οΈ Sentinel: [CRITICAL] Fix arbitrary command execution via profile.bitcoin_cli#35
Conversation
Co-authored-by: bitcoiner-dev <75873427+bitcoiner-dev@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 application was sourcing the
bitcoin_cliexecutable path from the user'sProfileconfiguration and passing it directly tostd::process::Command::newwithout any validation. WhileCommand::newmitigates shell injection (e.g.,; rm -rf /), it still allows execution of arbitrary system binaries if a malicious or tampered user profile specifies an absolute path like/bin/shor/usr/bin/pythonwith arbitrary arguments.π― Impact: If a user runs the application with a malicious, compromised, or mistakenly configured user profile, the application could be hijacked to execute arbitrary system binaries and commands with the privileges of the user running the application.
π§ Fix: Implemented a strict validation function
crate::utils::validate_bitcoin_cli_paththat enforces the path only targets exactlybitcoin-cliorbitcoin-cli.exeand rejects any other binaries or directory traversal attempts. In addition, an insecure, duplicate implementation ofrun_bitcoin_cliinsrc/wallet_service.rswas removed to ensure all code paths utilize the secure implementation.β Verification: Verified that
cargo test --bin zinc-clipasses without regressions.PR created automatically by Jules for task 15174604806940241753 started by @bitcoiner-dev