-
Notifications
You must be signed in to change notification settings - Fork 6.7k
feat: more safe commands #7728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: more safe commands #7728
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,19 +49,35 @@ fn is_safe_to_call_with_exec(command: &[String]) -> bool { | |
| { | ||
| #[rustfmt::skip] | ||
| Some( | ||
| "base64" | | ||
| "cat" | | ||
| "cd" | | ||
| "cut" | | ||
| "echo" | | ||
| "env" | | ||
| "expr" | | ||
jif-oai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "false" | | ||
| "grep" | | ||
| "head" | | ||
| "id" | | ||
| "ls" | | ||
| "nl" | | ||
| "numfmt" | | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this Linux only? I don't see this on my Mac. |
||
| "paste" | | ||
| "pwd" | | ||
| "rev" | | ||
| "seq" | | ||
| "stat" | | ||
| "tac" | | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also not on Mac. For the ones that are not natively in [root-owned] Admittedly, on both Mac or Linux, someone could inject their own version of |
||
| "tail" | | ||
| "tr" | | ||
| "true" | | ||
| "uname" | | ||
| "uniq" | | ||
| "wc" | | ||
| "which") => { | ||
| "which" | | ||
| "whoami" | | ||
| "yes") => { | ||
| true | ||
| }, | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible to specify an output file for
base64with the-oflag. Would lead to an unintended write, assuming safe commands are supposed to be read-onlye.g.
base64 -d -o /tmp/x payloadbypasses approval even though it mutates the filesystemBSD docs: https://ss64.com/mac/base64.html