Skip to content

Commit 2bfbc2f

Browse files
committed
added @ and + to dangerous patterns and updated syntax for feed.json
1 parent 7025364 commit 2bfbc2f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

crates/chat-cli/src/cli/chat/tools/execute/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ impl ExecuteCommand {
5959
let Some(args) = shlex::split(&self.command) else {
6060
return true;
6161
};
62-
const DANGEROUS_PATTERNS: &[&str] = &["<(", "$(", "`", ">", "&&", "||", "&", ";", "$", "\n", "\r", "IFS"];
62+
const DANGEROUS_PATTERNS: &[&str] = &[
63+
"<(", "$(", "`", ">", "&&", "||", "&", ";", "$", "\n", "\r", "IFS", "@", "+",
64+
];
6365

6466
if args
6567
.iter()
@@ -442,6 +444,8 @@ mod tests {
442444
("echo 'test\nrm file'", true),
443445
("echo 'test\rrm file'", true),
444446
("IFS=/ malicious", true),
447+
(r#"/c/"+"/m/"+"/d/.exe"#, true),
448+
("$^(calc.exe)", true),
445449
];
446450
for (cmd, expected) in cmds {
447451
let tool = serde_json::from_value::<ExecuteCommand>(serde_json::json!({

crates/chat-cli/src/cli/feed.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"description": "Right arrow key being disabled - [#3439](https://github.com/aws/amazon-q-developer-cli/pull/3439)"
2222
}
2323
]
24-
}{
24+
},
25+
{
2526
"type": "release",
2627
"date": "2025-11-12",
2728
"version": "1.19.5",
@@ -1382,4 +1383,4 @@
13821383
"link": "https://aws.amazon.com/blogs/aws/amazon-q-developer-now-generally-available-includes-new-capabilities-to-reimagine-developer-experience/"
13831384
}
13841385
]
1385-
}
1386+
}

0 commit comments

Comments
 (0)