A shell command is built from request input
What it finds
system("convert " . $_GET['file']): a shell command built from what the request sent lets the sender run commands of their own. system, exec, shell_exec, passthru, popen, proc_open, pcntl_exec and backticks are checked; escapeshellarg around the value, or a fixed list of allowed values, prevents it.
From the rule's source, command_from_request.rs.
<?phpfunction convert(){ system('convert ' . $_GET['file']);tx0 reports: request input from $_GET reaches the shell command $out = `ls {$_POST['dir']}`;tx0 reports: request input from $_POST reaches the shell command exec('convert ' . escapeshellarg($_GET['file'])); return $out;} Turn it on, off or suppress it
The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:
[rules]
"tx0/php:command-from-request" = "off"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/php:command-from-request] reason="..."tx0 explain tx0/php:command-from-request shows the same in the terminal. Found a false positive? Report it.