Pattern: Function call with shell=True
Issue: -
This rule interrogates method calls for the presence of a keyword parameter shell equaling true. It is related to detection of shell injection issues and is intended to catch custom wrappers to vulnerable methods that may have been created.
Example of insecure code:
def Popen(*args, **kwargs):
print('hi')
Popen('/bin/gcc --version', shell=True)
Example of secure code:
def Popen(*args, **kwargs):
print('hi')
Popen('/bin/gcc --version', shell=False)