$ bandit -r . [bandit] INFO using config: /etc/bandit/bandit.yaml [bandit] INFO running on Python 2.7.10 Run started: 2015-09-07 22:50:34.739237 Files skipped (0): Test results: >> Issue: Try, Except, Pass detected. Severity: Low Confidence: High Location: ./onionshare/onionshare.py:85 84 self.controller.close() 85 except: 86 pass >> Issue: subprocess call - check for execution of untrusted input. Severity: Low Confidence: High Location: ./onionshare/onionshare.py:114 113 print "Executing: {0:s}".format(args+[str(self.port)]) 114 p = subprocess.Popen(args+[str(self.port)], stderr=subprocess.PIPE, stdout=subprocess.PIPE) 115 stdout = p.stdout.read(22) # .onion URLs are 22 chars long >> Issue: Probable insecure usage of temp file/directory. Severity: Medium Confidence: Medium Location: ./onionshare/onionshare.py:144 143 # in non-Tails linux, onionshare will create HS dir in /tmp/onionshare/* 144 path = '/tmp/onionshare' 145 try: >> Issue: Try, Except, Pass detected. Severity: Low Confidence: High Location: ./onionshare/onionshare.py:164 163 break 164 except: 165 pass >> Issue: Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected. Severity: Medium Confidence: High Location: ./onionshare/onionshare.py:205 204 # so no need to set the socks5 proxy 205 urllib2.urlopen('http://{0:s}'.format(self.onion_host)) 206 else: >> Issue: Try, Except, Pass detected. Severity: Low Confidence: High Location: ./onionshare/onionshare.py:217 216 break 217 except socks.ProxyConnectionError: 218 pass >> Issue: subprocess call - check for execution of untrusted input. Severity: Low Confidence: High Location: ./onionshare/onionshare.py:252 251 # open hole in firewall 252 subprocess.call(['/sbin/iptables', '-I', 'OUTPUT', '-o', 'lo', 253 '-p', 'tcp', '--dport', str(port), '-j', 'ACCEPT']) 254 >> Issue: subprocess call - check for execution of untrusted input. Severity: Low Confidence: High Location: ./onionshare/onionshare.py:267 266 def handler(signum=None, frame=None): 267 subprocess.call(['/sbin/iptables', '-D', 'OUTPUT', '-o', 'lo', 268 '-p', 'tcp', '--dport', str(port), '-j', 'ACCEPT']) 269 sys.exit() >> Issue: Possible binding to all interfaces. Severity: Medium Confidence: Medium Location: ./onionshare/socks.py:474 473 474 self.proxy_sockname = (b"0.0.0.0", 0) 475 self.proxy_peername = addr, dest_port >> Issue: Probable insecure usage of temp file/directory. Severity: Medium Confidence: Medium Location: ./onionshare/web.py:103 102 else: 103 temp_dir = '/tmp/' 104 >> Issue: Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected. Severity: Medium Confidence: High Location: ./onionshare/web.py:243 242 else: 243 urllib2.urlopen('http://127.0.0.1:{0:d}/{1:s}/shutdown'.format(port, shutdown_slug)).read() 244 >> Issue: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Severity: Low Confidence: High Location: ./test/onionshare_helpers_test.py:29 28 '#1 SMP Debian 3.14.4-1 (2014-05-13)', 'x86_64', '') 29 assert helpers.get_platform() == 'Tails' 30 >> Issue: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Severity: Low Confidence: High Location: ./test/onionshare_helpers_test.py:35 34 helpers.platform.system = lambda: 'Sega Saturn' 35 assert helpers.get_platform() == 'Sega Saturn' 36 >> Issue: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Severity: Low Confidence: High Location: ./test/onionshare_strings_test.py:27 26 """creates an empty strings dict by default""" 27 assert strings.strings == {} 28 >> Issue: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Severity: Low Confidence: High Location: ./test/onionshare_strings_test.py:34 33 strings.load_strings() 34 assert strings._('wait_for_hs') == "Waiting for HS to be ready:" 35 >> Issue: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Severity: Low Confidence: High Location: ./test/onionshare_strings_test.py:41 40 strings.load_strings("fr") 41 assert strings._('wait_for_hs') == "En attente du HS:" 42 >> Issue: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Severity: Low Confidence: High Location: ./test/onionshare_test.py:28 27 app.choose_port() 28 assert 1024 <= app.port <= 65535 29 >> Issue: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Severity: Low Confidence: High Location: ./test/onionshare_web_test.py:25 24 """generates a 26-character slug""" 25 assert len(web.slug) == 26 26 >> Issue: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Severity: Low Confidence: High Location: ./test/onionshare_web_test.py:35 34 35 assert is_b32(web.slug) 36