OS commands are security-sensitive. For example, their use has led in the past to the following vulnerabilities:

Applications that execute operating system commands or execute commands that interact with the underlying system should neutralize any externally-provided input used to construct those commands. Failure to do so could allow an attacker to execute unexpected or dangerous commands, potentially leading to loss of confidentiality, integrity or availability.

Ask Yourself Whether

(*) You are at risk if you answered yes to any of those questions.

Recommended Secure Coding Practices

Restrict the control given to the user over the executed command:

Restrict which users can have access to the command

Reduce the damage the command can do:

See