Skip to main content

All Questions

5 votes
2 answers
2k views

How to re-write this function to avoid argument injection

I have a function in my .bashrc file that allows me to run a script on a remote server with arguments via ssh. Currently, the function contains: function runMyScript { if [ $1 = "s3" ] then ...
cpd's user avatar
  • 153
14 votes
4 answers
19k views

How to prevent command injection through command options?

I have an wrapper application where I need to let the user specify custom options to pass to a simulator. However, I want to make sure the user doesn't inject other commands through the user options. ...
Victor L's user avatar
  • 409