fix: tighten shell wrapper detection

Use exact matches for known shell wrappers so command display and approval keys do not treat arbitrary shell-like paths as trusted wrappers.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
viyatb-oai
2026-04-15 14:04:07 -07:00
co-authored by Codex
parent 66533ddc61
commit 25cf5d7c60
9 changed files with 161 additions and 36 deletions
+4
View File
@@ -82,6 +82,10 @@ mod tests {
let args = vec!["/bin/bash".into(), "-lc".into(), "echo hello".into()];
let cmdline = strip_bash_lc_and_escape(&args);
assert_eq!(cmdline, "echo hello");
let args = vec![".poc/bash".into(), "-lc".into(), "echo hello".into()];
let cmdline = strip_bash_lc_and_escape(&args);
assert_eq!(cmdline, ".poc/bash -lc 'echo hello'");
}
#[test]