Shell scripts and security

前端 未结 4 784
攒了一身酷
攒了一身酷 2021-01-13 05:17

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

4条回答
  •  我在风中等你
    2021-01-13 05:55

    Probably because it's just easy to screw up. When the PATH is not set correctly, your script will start executing the wrong commands. Putting a space somewhere in a string might cause it to become two strings later on. These can lead to exploitable security holes. In short: shells give you some guarantees as to how your script will behave, but they're too weak or too complex for truly secure programming.

    (To this I would like to add that secure programming is an art in itself, and screwing up is possible in any language.)

提交回复
热议问题