|
1 | 1 | ---
|
2 | 2 | source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs
|
3 | 3 | ---
|
4 |
| -S603.py:4:1: S603 `subprocess` call: check for execution of untrusted input |
| 4 | +S603.py:5:1: S603 `subprocess` call: check for execution of untrusted input |
5 | 5 | |
|
6 | 6 | 3 | # Different Popen wrappers are checked.
|
7 |
| -4 | Popen("true", shell=False) |
| 7 | +4 | a = input() |
| 8 | +5 | Popen(a, shell=False) |
8 | 9 | | ^^^^^ S603
|
9 |
| -5 | call("true", shell=False) |
10 |
| -6 | check_call("true", shell=False) |
| 10 | +6 | call(a, shell=False) |
| 11 | +7 | check_call(a, shell=False) |
11 | 12 | |
|
12 | 13 |
|
13 |
| -S603.py:5:1: S603 `subprocess` call: check for execution of untrusted input |
| 14 | +S603.py:6:1: S603 `subprocess` call: check for execution of untrusted input |
14 | 15 | |
|
15 |
| -3 | # Different Popen wrappers are checked. |
16 |
| -4 | Popen("true", shell=False) |
17 |
| -5 | call("true", shell=False) |
| 16 | +4 | a = input() |
| 17 | +5 | Popen(a, shell=False) |
| 18 | +6 | call(a, shell=False) |
18 | 19 | | ^^^^ S603
|
19 |
| -6 | check_call("true", shell=False) |
20 |
| -7 | check_output("true", shell=False) |
| 20 | +7 | check_call(a, shell=False) |
| 21 | +8 | check_output(a, shell=False) |
21 | 22 | |
|
22 | 23 |
|
23 |
| -S603.py:6:1: S603 `subprocess` call: check for execution of untrusted input |
| 24 | +S603.py:7:1: S603 `subprocess` call: check for execution of untrusted input |
24 | 25 | |
|
25 |
| -4 | Popen("true", shell=False) |
26 |
| -5 | call("true", shell=False) |
27 |
| -6 | check_call("true", shell=False) |
| 26 | +5 | Popen(a, shell=False) |
| 27 | +6 | call(a, shell=False) |
| 28 | +7 | check_call(a, shell=False) |
28 | 29 | | ^^^^^^^^^^ S603
|
29 |
| -7 | check_output("true", shell=False) |
30 |
| -8 | run("true", shell=False) |
| 30 | +8 | check_output(a, shell=False) |
| 31 | +9 | run(a, shell=False) |
31 | 32 | |
|
32 | 33 |
|
33 |
| -S603.py:7:1: S603 `subprocess` call: check for execution of untrusted input |
| 34 | +S603.py:8:1: S603 `subprocess` call: check for execution of untrusted input |
34 | 35 | |
|
35 |
| -5 | call("true", shell=False) |
36 |
| -6 | check_call("true", shell=False) |
37 |
| -7 | check_output("true", shell=False) |
| 36 | +6 | call(a, shell=False) |
| 37 | +7 | check_call(a, shell=False) |
| 38 | +8 | check_output(a, shell=False) |
38 | 39 | | ^^^^^^^^^^^^ S603
|
39 |
| -8 | run("true", shell=False) |
| 40 | +9 | run(a, shell=False) |
40 | 41 | |
|
41 | 42 |
|
42 |
| -S603.py:8:1: S603 `subprocess` call: check for execution of untrusted input |
| 43 | +S603.py:9:1: S603 `subprocess` call: check for execution of untrusted input |
43 | 44 | |
|
44 |
| - 6 | check_call("true", shell=False) |
45 |
| - 7 | check_output("true", shell=False) |
46 |
| - 8 | run("true", shell=False) |
| 45 | + 7 | check_call(a, shell=False) |
| 46 | + 8 | check_output(a, shell=False) |
| 47 | + 9 | run(a, shell=False) |
47 | 48 | | ^^^ S603
|
48 |
| - 9 | |
49 |
| -10 | # Values that falsey values are treated as false. |
| 49 | +10 | |
| 50 | +11 | # Falsey values are treated as false. |
50 | 51 | |
|
51 | 52 |
|
52 |
| -S603.py:11:1: S603 `subprocess` call: check for execution of untrusted input |
| 53 | +S603.py:12:1: S603 `subprocess` call: check for execution of untrusted input |
53 | 54 | |
|
54 |
| -10 | # Values that falsey values are treated as false. |
55 |
| -11 | Popen("true", shell=0) |
| 55 | +11 | # Falsey values are treated as false. |
| 56 | +12 | Popen(a, shell=0) |
56 | 57 | | ^^^^^ S603
|
57 |
| -12 | Popen("true", shell=[]) |
58 |
| -13 | Popen("true", shell={}) |
| 58 | +13 | Popen(a, shell=[]) |
| 59 | +14 | Popen(a, shell={}) |
59 | 60 | |
|
60 | 61 |
|
61 |
| -S603.py:12:1: S603 `subprocess` call: check for execution of untrusted input |
| 62 | +S603.py:13:1: S603 `subprocess` call: check for execution of untrusted input |
62 | 63 | |
|
63 |
| -10 | # Values that falsey values are treated as false. |
64 |
| -11 | Popen("true", shell=0) |
65 |
| -12 | Popen("true", shell=[]) |
| 64 | +11 | # Falsey values are treated as false. |
| 65 | +12 | Popen(a, shell=0) |
| 66 | +13 | Popen(a, shell=[]) |
66 | 67 | | ^^^^^ S603
|
67 |
| -13 | Popen("true", shell={}) |
68 |
| -14 | Popen("true", shell=None) |
| 68 | +14 | Popen(a, shell={}) |
| 69 | +15 | Popen(a, shell=None) |
69 | 70 | |
|
70 | 71 |
|
71 |
| -S603.py:13:1: S603 `subprocess` call: check for execution of untrusted input |
| 72 | +S603.py:14:1: S603 `subprocess` call: check for execution of untrusted input |
72 | 73 | |
|
73 |
| -11 | Popen("true", shell=0) |
74 |
| -12 | Popen("true", shell=[]) |
75 |
| -13 | Popen("true", shell={}) |
| 74 | +12 | Popen(a, shell=0) |
| 75 | +13 | Popen(a, shell=[]) |
| 76 | +14 | Popen(a, shell={}) |
76 | 77 | | ^^^^^ S603
|
77 |
| -14 | Popen("true", shell=None) |
| 78 | +15 | Popen(a, shell=None) |
78 | 79 | |
|
79 | 80 |
|
80 |
| -S603.py:14:1: S603 `subprocess` call: check for execution of untrusted input |
| 81 | +S603.py:15:1: S603 `subprocess` call: check for execution of untrusted input |
81 | 82 | |
|
82 |
| -12 | Popen("true", shell=[]) |
83 |
| -13 | Popen("true", shell={}) |
84 |
| -14 | Popen("true", shell=None) |
| 83 | +13 | Popen(a, shell=[]) |
| 84 | +14 | Popen(a, shell={}) |
| 85 | +15 | Popen(a, shell=None) |
85 | 86 | | ^^^^^ S603
|
86 |
| -15 | |
87 |
| -16 | # Unknown values are treated as falsey. |
| 87 | +16 | |
| 88 | +17 | # Unknown values are treated as falsey. |
| 89 | + | |
| 90 | + |
| 91 | +S603.py:18:1: S603 `subprocess` call: check for execution of untrusted input |
| 92 | + | |
| 93 | +17 | # Unknown values are treated as falsey. |
| 94 | +18 | Popen(a, shell=True if True else False) |
| 95 | + | ^^^^^ S603 |
| 96 | +19 | |
| 97 | +20 | # No value is also caught. |
| 98 | + | |
| 99 | + |
| 100 | +S603.py:21:1: S603 `subprocess` call: check for execution of untrusted input |
| 101 | + | |
| 102 | +20 | # No value is also caught. |
| 103 | +21 | Popen(a) |
| 104 | + | ^^^^^ S603 |
| 105 | +22 | |
| 106 | +23 | # Literals are fine, they're trusted. |
| 107 | + | |
| 108 | + |
| 109 | +S603.py:24:1: S603 `subprocess` call: check for execution of untrusted input |
| 110 | + | |
| 111 | +23 | # Literals are fine, they're trusted. |
| 112 | +24 | run("true") |
| 113 | + | ^^^ S603 |
| 114 | +25 | Popen(["true"]) |
| 115 | +26 | Popen("true", shell=False) |
88 | 116 | |
|
89 | 117 |
|
90 |
| -S603.py:17:1: S603 `subprocess` call: check for execution of untrusted input |
| 118 | +S603.py:25:1: S603 `subprocess` call: check for execution of untrusted input |
91 | 119 | |
|
92 |
| -16 | # Unknown values are treated as falsey. |
93 |
| -17 | Popen("true", shell=True if True else False) |
| 120 | +23 | # Literals are fine, they're trusted. |
| 121 | +24 | run("true") |
| 122 | +25 | Popen(["true"]) |
94 | 123 | | ^^^^^ S603
|
95 |
| -18 | |
96 |
| -19 | # No value is also caught. |
| 124 | +26 | Popen("true", shell=False) |
| 125 | +27 | call("true", shell=False) |
97 | 126 | |
|
98 | 127 |
|
99 |
| -S603.py:20:1: S603 `subprocess` call: check for execution of untrusted input |
| 128 | +S603.py:26:1: S603 `subprocess` call: check for execution of untrusted input |
100 | 129 | |
|
101 |
| -19 | # No value is also caught. |
102 |
| -20 | Popen("true") |
| 130 | +24 | run("true") |
| 131 | +25 | Popen(["true"]) |
| 132 | +26 | Popen("true", shell=False) |
103 | 133 | | ^^^^^ S603
|
| 134 | +27 | call("true", shell=False) |
| 135 | +28 | check_call("true", shell=False) |
| 136 | + | |
| 137 | + |
| 138 | +S603.py:27:1: S603 `subprocess` call: check for execution of untrusted input |
| 139 | + | |
| 140 | +25 | Popen(["true"]) |
| 141 | +26 | Popen("true", shell=False) |
| 142 | +27 | call("true", shell=False) |
| 143 | + | ^^^^ S603 |
| 144 | +28 | check_call("true", shell=False) |
| 145 | +29 | check_output("true", shell=False) |
| 146 | + | |
| 147 | + |
| 148 | +S603.py:28:1: S603 `subprocess` call: check for execution of untrusted input |
| 149 | + | |
| 150 | +26 | Popen("true", shell=False) |
| 151 | +27 | call("true", shell=False) |
| 152 | +28 | check_call("true", shell=False) |
| 153 | + | ^^^^^^^^^^ S603 |
| 154 | +29 | check_output("true", shell=False) |
| 155 | +30 | run("true", shell=False) |
| 156 | + | |
| 157 | + |
| 158 | +S603.py:29:1: S603 `subprocess` call: check for execution of untrusted input |
| 159 | + | |
| 160 | +27 | call("true", shell=False) |
| 161 | +28 | check_call("true", shell=False) |
| 162 | +29 | check_output("true", shell=False) |
| 163 | + | ^^^^^^^^^^^^ S603 |
| 164 | +30 | run("true", shell=False) |
| 165 | + | |
| 166 | + |
| 167 | +S603.py:30:1: S603 `subprocess` call: check for execution of untrusted input |
| 168 | + | |
| 169 | +28 | check_call("true", shell=False) |
| 170 | +29 | check_output("true", shell=False) |
| 171 | +30 | run("true", shell=False) |
| 172 | + | ^^^ S603 |
| 173 | +31 | |
| 174 | +32 | # Not through assignments though. |
| 175 | + | |
| 176 | + |
| 177 | +S603.py:34:1: S603 `subprocess` call: check for execution of untrusted input |
| 178 | + | |
| 179 | +32 | # Not through assignments though. |
| 180 | +33 | cmd = ["true"] |
| 181 | +34 | run(cmd) |
| 182 | + | ^^^ S603 |
| 183 | +35 | |
| 184 | +36 | # Instant named expressions are fine. |
| 185 | + | |
| 186 | + |
| 187 | +S603.py:37:1: S603 `subprocess` call: check for execution of untrusted input |
| 188 | + | |
| 189 | +36 | # Instant named expressions are fine. |
| 190 | +37 | run(c := "true") |
| 191 | + | ^^^ S603 |
| 192 | +38 | |
| 193 | +39 | # But non-instant are not. |
| 194 | + | |
| 195 | + |
| 196 | +S603.py:41:1: S603 `subprocess` call: check for execution of untrusted input |
| 197 | + | |
| 198 | +39 | # But non-instant are not. |
| 199 | +40 | (e := "echo") |
| 200 | +41 | run(e) |
| 201 | + | ^^^ S603 |
104 | 202 | |
|
0 commit comments