Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/chat-cli/src/cli/chat/tools/execute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl ExecuteCommand {
let Some(args) = shlex::split(&self.command) else {
return true;
};
const DANGEROUS_PATTERNS: &[&str] = &["<(", "$(", "`", ">", "&&", "||", "&", ";", "${", "\n", "\r", "IFS"];
const DANGEROUS_PATTERNS: &[&str] = &["<(", "$(", "`", ">", "&&", "||", "&", ";", "$", "\n", "\r", "IFS"];

if args
.iter()
Expand Down Expand Up @@ -328,6 +328,7 @@ mod tests {
(r#"find / -fprintf "/path/to/file" <data-to-write> -quit"#, true),
(r"find . -${t}exec touch asdf \{\} +", true),
(r"find . -${t:=exec} touch asdf2 \{\} +", true),
(r#"find /tmp -name "*" -exe$9c touch /tmp/find_result {} +"#, true),
// `grep` command arguments
("echo 'test data' | grep -P '(?{system(\"date\")})'", true),
("echo 'test data' | grep --perl-regexp '(?{system(\"date\")})'", true),
Expand Down
Loading