Skip to content

Files

Latest commit

 

History

History
32 lines (20 loc) · 938 Bytes

B604.md

File metadata and controls

32 lines (20 loc) · 938 Bytes

Pattern: Function call with shell=True

Issue: -

Description

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)

Further Reading