Repository navigation
π‘οΈ Sentinel: [CRITICAL] Fix Path Traversal in agent workdir commands - #268
Conversation
π¨ Severity: CRITICAL π‘ Vulnerability: The `validate_read_only` function in `crates/agent/src/tools/workdir_cmd.rs` used a naive `BLOCKED_TOKENS` blocklist on the raw command string, failing to account for shell argument obfuscation via quotation (e.g., `cat ".."/".."`). This allowed directory traversal vulnerabilities for ostensibly read-only commands. π― Impact: Attackers could execute read-only commands to traverse directories and read sensitive files outside of the intended scope. π§ Fix: Updated the check inside `validate_read_only` to verify for `..` inside the already split and tokenized command arguments, robustly blocking traversal attempts regardless of how they are quoted. β Verification: Ensure tests pass `cargo test -p devforge-agent --lib tools::workdir_cmd::tests` with the new regression test coverage added for `cat ".."/".."/etc/passwd`. Co-authored-by: bobdivx <6737167+bobdivx@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. |
# Conflicts: # .jules/sentinel.md
# Conflicts: # .jules/sentinel.md
π‘οΈ Sentinel: [CRITICAL] Fix Path Traversal in agent workdir commands
π¨ Severity: CRITICAL
π‘ Vulnerability: The
validate_read_onlyfunction incrates/agent/src/tools/workdir_cmd.rsused a naiveBLOCKED_TOKENSblocklist on the raw command string, failing to account for shell argument obfuscation via quotation (e.g.,cat ".."/".."). This allowed directory traversal vulnerabilities for ostensibly read-only commands.π― Impact: Attackers could execute read-only commands to traverse directories and read sensitive files outside of the intended scope.
π§ Fix: Updated the check inside
validate_read_onlyto verify for..inside the already split and tokenized command arguments, robustly blocking traversal attempts regardless of how they are quoted.β Verification: Ensure tests pass
cargo test -p devforge-agent --lib tools::workdir_cmd::testswith the new regression test coverage added forcat ".."/".."/etc/passwd.PR created automatically by Jules for task 10617239769117897158 started by @bobdivx