Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shell scripts and security

TLDP's Advanced Bash Scripting Guide states that shell scripts shouldn't be used for "situations where security is important, where you need to guarantee the integrity of your system and protect against intrusion, cracking, and vandalism."

What makes shell scripts unsuitable for such a use case?

like image 414
Matty Avatar asked Jan 20 '12 00:01

Matty


1 Answers

Because of the malleability of the shell, it is difficult to verify that a shell script performs its intended function and only that function in the face of adversarial input. The way the shell behaves depends on the environment, plus the settings of its own numerous configuration variables. Each command line is subject to multiple levels of expansion, evaluation and interpolation. Some shell constructs run in subprocesses while the variables the construct contains are expanded in the parent process. All of this is counter to the KISS principle when designing systems that might be attacked.

like image 62
Kyle Jones Avatar answered Oct 11 '22 07:10

Kyle Jones