-
Notifications
You must be signed in to change notification settings - Fork 250
Commit 2e91ce7
Chained function calls separated into multiple assignments
Take the example from examples/vulnerable_code/sql/sqli.py:
`result = session.query(User).filter("username={}".format(TAINT))`
The `filter` function is marked as a sink. However, previously this did
not get marked as a vulnerability.
The call label used to be `session.query`, ignoring the filter function.
Now, when the file is read, it is transformed into 2 lines:
```
__chain_tmp_1 = session.query(User)
result = __chain_tmp_1.filter("username={}".format(TAINT))
```
And the vulnerability is found.
We don't find everything here: just ordinary assignments and return
statements. We can't just transform all Call nodes here since Call nodes
can appear in many different scenarios e.g. comprehensions, bare
function calls.1 parent 11567c4 commit 2e91ce7
File tree
6 files changed
+108
-7
lines changed- pyt/core
- tests
- cfg
- core
- vulnerabilities
6 files changed
+108
-7
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 | - | ||
9 | + | ||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
38 | - | ||
38 | + | ||
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
|
Lines changed: 51 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 | - | ||
4 | + | ||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | ||
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | + | ||
28 | + | ||
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | ||
68 | + |
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 | + | ||
7 | 8 |
| |
8 | 9 |
| |
9 | 10 |
| |
| |||
36 | 37 |
| |
37 | 38 |
| |
38 | 39 |
| |
39 | - | ||
40 | + | ||
40 | 41 |
| |
41 | 42 |
| |
42 | 43 |
| |
|
Lines changed: 32 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1497 | 1497 |
| |
1498 | 1498 |
| |
1499 | 1499 |
| |
1500 | + | ||
1501 | + | ||
1502 | + | ||
1503 | + | ||
1504 | + | ||
1505 | + | ||
1506 | + | ||
1507 | + | ||
1508 | + | ||
1509 | + | ||
1510 | + | ||
1511 | + | ||
1512 | + | ||
1513 | + | ||
1514 | + | ||
1515 | + | ||
1516 | + | ||
1517 | + | ||
1518 | + | ||
1519 | + | ||
1520 | + | ||
1521 | + | ||
1522 | + | ||
1523 | + | ||
1524 | + | ||
1525 | + | ||
1526 | + | ||
1527 | + | ||
1528 | + | ||
1529 | + | ||
1530 | + | ||
1531 | + |
Lines changed: 20 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 | - | ||
4 | + | ||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 | + | ||
11 | 12 |
| |
12 | 13 |
| |
13 | 14 |
| |
| |||
30 | 31 |
| |
31 | 32 |
| |
32 | 33 |
| |
33 | - | ||
34 | + | ||
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
38 | + | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | + |
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
282 | 282 |
| |
283 | 283 |
| |
284 | 284 |
| |
285 | - | ||
285 | + | ||
286 | 286 |
| |
287 | 287 |
| |
288 | 288 |
| |
|
0 commit comments