by hn92726819 · 2y ago · 0 comments
// Construct the command we want the $SHELL to execute
let command = format!("cd {:?}; /usr/bin/env -0;", dir);
SQL Injection-like attacks continues to resurface. You should pass it as a parameter in the future. Untested, but something like this: format!("cd \"$1\"; ...");
command.args([command, dir]); $(rm -rf /*; echo /)
That's a valid Unix path, but rust's quoting does nothing to stop it: https://play.rust-lang.org/?version=stable&mode=debug&editio...