A command is run through the shell with system or popen

tx0/c:shell-command-callstrictwarningsecurity/injectiondepth fastsecurity, cwe-78

What it finds

system("rm -rf /tmp/cache"): the shell interprets the string, so the result depends on the environment, PATH included, and any part of the command that comes from outside can run other commands. posix_spawn or fork and execv run a program with arguments directly.

From the rule's source, shell_command_call.rs.

Example from the rule's tests
#include <stdlib.h> int clean(void){  return system("rm -rf /tmp/cache");tx0 reports: system runs a command through the shell}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/c:shell-command-call" = "warning"

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/c:shell-command-call] reason="..."

tx0 explain tx0/c:shell-command-call shows the same in the terminal. Found a false positive? Report it.