Skip to content

Commit 027c3c0

Browse files
authored
Disable support for '-fls' option in find command for security reasone (#3033)
1 parent e1a1981 commit 027c3c0

File tree

1 file changed

+2
-0
lines changed
  • crates/chat-cli/src/cli/chat/tools/execute

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ impl ExecuteCommand {
113113
|| arg.contains("-delete")
114114
|| arg.contains("-ok") // includes -okdir
115115
|| arg.contains("-fprint") // includes -fprint0 and -fprintf
116+
|| arg.contains("-fls")
116117
}) =>
117118
{
118119
return true;
@@ -334,6 +335,7 @@ mod tests {
334335
("find important-dir/ -exec rm {} \\;", true),
335336
("find . -name '*.c' -execdir gcc -o '{}.out' '{}' \\;", true),
336337
("find important-dir/ -delete", true),
338+
("find important-dir/ -fls /etc/passwd", true),
337339
(
338340
"echo y | find . -type f -maxdepth 1 -okdir open -a Calculator {} +",
339341
true,

0 commit comments

Comments
 (0)