ajenti / ajenti

Detected subprocess popen call with shell equals True BAN-B602
Security
Major
6 months ago2 years old
subprocess call with shell=True identified, security issue.
 75
 76    return subprocess.check_output(
 77        f"ip route | grep default | grep {iface} | cut -d' ' -f3",
 78        shell=True, 79        encoding='utf-8' 80    ) 81
 82
 83def ifconfig_get_up(iface):
subprocess call with shell=True identified, security issue.
 55    try:
 56        inet_line = subprocess.check_output(
 57            f"ip -6 addr show {iface} | grep 'inet6 '",
 58            shell=True, 59            encoding='utf-8' 60        ) 61        return inet_line.strip().split()[1].split('/')
 62    except subprocess.CalledProcessError as e:
 63        # No ipv6 found
subprocess call with shell=True identified, security issue.
 34    try:
 35        inet_line = subprocess.check_output(
 36            f"ip -4 addr show {iface} | grep 'inet '",
 37            shell=True, 38            encoding='utf-8' 39        ) 40        return inet_line.strip().split()[1].split('/')
 41    except subprocess.CalledProcessError as e:
 42        # No ipv4 found