|
2 | 2 |
|
3 | 3 | # binds to all interfaces, insecure |
4 | 4 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
5 | | -s.bind(('0.0.0.0', 31137)) |
| 5 | +s.bind(('0.0.0.0', 31137)) # $ Alert[py/bind-socket-all-network-interfaces] |
6 | 6 |
|
7 | 7 | # binds to all interfaces, insecure |
8 | 8 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
9 | | -s.bind(('', 4040)) |
| 9 | +s.bind(('', 4040)) # $ Alert[py/bind-socket-all-network-interfaces] |
10 | 10 |
|
11 | 11 | # binds only to a dedicated interface, secure |
12 | 12 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
13 | 13 | s.bind(('84.68.10.12', 8080)) |
14 | 14 |
|
15 | 15 | # binds to all interfaces, insecure |
16 | 16 | ALL_LOCALS = "0.0.0.0" |
17 | | -s.bind((ALL_LOCALS, 9090)) |
| 17 | +s.bind((ALL_LOCALS, 9090)) # $ Alert[py/bind-socket-all-network-interfaces] |
18 | 18 |
|
19 | 19 | # binds to all interfaces, insecure |
20 | 20 | tup = (ALL_LOCALS, 8080) |
21 | | -s.bind(tup) |
| 21 | +s.bind(tup) # $ Alert[py/bind-socket-all-network-interfaces] |
22 | 22 |
|
23 | 23 |
|
24 | 24 | # IPv6 |
25 | 25 | s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) |
26 | | -s.bind(("::", 8080)) # NOT OK |
| 26 | +s.bind(("::", 8080)) # $ Alert[py/bind-socket-all-network-interfaces] |
0 commit comments