heat-cfntools/heat_cfntools
Anant Patil e424af2236 Fix cfntools command injection
The CommandRunner used to run commands using su command and passing the
actual command to be run as argument to it.

su USER -c <cmd>

This is susceptible to command line injection as noted in the bug.

The fix required to do two things:

1. Pass the command to be run as list instead of a string. This is to
ensure that the actual arguments are passed as arguments to the program
ought to be executed. And by doing so, avoids running any commands
passed in the argument. On the contrary, if the command were passed as a
string to the shell, the arguments could be formed in a way to execute
malicious commands.

2. The CommandRunner runs the command directly and uses setuid to lower
the privileges if needed. If the 'runas' user is other than root, then
its UID is obtained and setuid is invoked to set the real user-id and
effective user-id to the given user.

Change-Id: I654117e994fd38411508dbe9b85d06c28dc0e411
Closes-Bug: #1312246
2015-08-31 15:58:04 +05:30
..
cfntools Fix cfntools command injection 2015-08-31 15:58:04 +05:30
tests Fix cfntools command injection 2015-08-31 15:58:04 +05:30
__init__.py rename python package heat_jeos to heat_cfntools 2012-12-24 17:07:35 +13:00