Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df8be43

Browse files
committed
Python: Show that list(tainted_string) works
1 parent 0da78f2 commit df8be43

4 files changed

Lines changed: 56 additions & 41 deletions

File tree

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
| Taint exception.info | test.py:60 | test.py:60:22:60:26 | taint | p1 = exception.info |
2-
| Taint exception.info | test.py:61 | test.py:61:12:61:22 | func() | p1 = exception.info |
3-
| Taint exception.info | test.py:61 | test.py:61:17:61:21 | taint | p1 = exception.info |
4-
| Taint exception.info | test.py:64 | test.py:64:12:64:33 | TAINTED_EXCEPTION_INFO | |
5-
| Taint exception.info | test.py:65 | test.py:65:11:65:41 | cross_over() | |
6-
| Taint exception.info | test.py:65 | test.py:65:37:65:40 | info | |
7-
| Taint exception.info | test.py:67 | test.py:67:19:67:21 | arg | p0 = exception.info |
8-
| Taint exception.info | test.py:68 | test.py:68:12:68:14 | arg | p0 = exception.info |
9-
| Taint externally controlled string | test.py:60 | test.py:60:22:60:26 | taint | p1 = externally controlled string |
10-
| Taint externally controlled string | test.py:61 | test.py:61:12:61:22 | func() | p1 = externally controlled string |
11-
| Taint externally controlled string | test.py:61 | test.py:61:17:61:21 | taint | p1 = externally controlled string |
12-
| Taint externally controlled string | test.py:67 | test.py:67:19:67:21 | arg | p0 = externally controlled string |
13-
| Taint externally controlled string | test.py:68 | test.py:68:12:68:14 | arg | p0 = externally controlled string |
14-
| Taint externally controlled string | test.py:71 | test.py:71:11:71:33 | TAINTED_EXTERNAL_STRING | |
15-
| Taint externally controlled string | test.py:72 | test.py:72:11:72:41 | cross_over() | |
16-
| Taint externally controlled string | test.py:72 | test.py:72:38:72:40 | ext | |
1+
| Taint exception.info | test.py:63 | test.py:63:22:63:26 | taint | p1 = exception.info |
2+
| Taint exception.info | test.py:64 | test.py:64:12:64:22 | func() | p1 = exception.info |
3+
| Taint exception.info | test.py:64 | test.py:64:17:64:21 | taint | p1 = exception.info |
4+
| Taint exception.info | test.py:67 | test.py:67:12:67:33 | TAINTED_EXCEPTION_INFO | |
5+
| Taint exception.info | test.py:68 | test.py:68:11:68:41 | cross_over() | |
6+
| Taint exception.info | test.py:68 | test.py:68:37:68:40 | info | |
7+
| Taint exception.info | test.py:70 | test.py:70:19:70:21 | arg | p0 = exception.info |
8+
| Taint exception.info | test.py:71 | test.py:71:12:71:14 | arg | p0 = exception.info |
9+
| Taint externally controlled string | test.py:63 | test.py:63:22:63:26 | taint | p1 = externally controlled string |
10+
| Taint externally controlled string | test.py:64 | test.py:64:12:64:22 | func() | p1 = externally controlled string |
11+
| Taint externally controlled string | test.py:64 | test.py:64:17:64:21 | taint | p1 = externally controlled string |
12+
| Taint externally controlled string | test.py:70 | test.py:70:19:70:21 | arg | p0 = externally controlled string |
13+
| Taint externally controlled string | test.py:71 | test.py:71:12:71:14 | arg | p0 = externally controlled string |
14+
| Taint externally controlled string | test.py:74 | test.py:74:11:74:33 | TAINTED_EXTERNAL_STRING | |
15+
| Taint externally controlled string | test.py:75 | test.py:75:11:75:41 | cross_over() | |
16+
| Taint externally controlled string | test.py:75 | test.py:75:38:75:40 | ext | |

python/ql/test/library-tests/taint/strings/TestNode.expected

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
| Taint [externally controlled string] | test.py:16 | test.py:16:9:16:27 | Attribute() | |
88
| Taint [externally controlled string] | test.py:17 | test.py:17:15:17:26 | tainted_list | |
99
| Taint [externally controlled string] | test.py:24 | test.py:24:14:24:34 | Attribute() | |
10+
| Taint [externally controlled string] | test.py:39 | test.py:39:20:39:35 | List | |
11+
| Taint [externally controlled string] | test.py:40 | test.py:40:22:40:36 | Tuple | |
1012
| Taint externally controlled string | test.py:5 | test.py:5:22:5:28 | TAINTED | |
1113
| Taint externally controlled string | test.py:6 | test.py:6:31:6:44 | tainted_string | |
1214
| Taint externally controlled string | test.py:7 | test.py:7:9:7:25 | Subscript | |
@@ -35,20 +37,23 @@
3537
| Taint externally controlled string | test.py:37 | test.py:37:14:37:27 | tainted_string | |
3638
| Taint externally controlled string | test.py:38 | test.py:38:9:38:22 | tainted_string | |
3739
| Taint externally controlled string | test.py:38 | test.py:38:9:38:30 | Attribute() | |
38-
| Taint externally controlled string | test.py:41 | test.py:41:22:41:28 | TAINTED | |
39-
| Taint externally controlled string | test.py:42 | test.py:42:8:42:21 | tainted_string | |
40-
| Taint externally controlled string | test.py:45 | test.py:45:23:45:36 | tainted_string | |
41-
| Taint externally controlled string | test.py:48 | test.py:48:22:48:28 | TAINTED | |
42-
| Taint externally controlled string | test.py:49 | test.py:49:8:49:21 | tainted_string | |
43-
| Taint externally controlled string | test.py:49 | test.py:49:34:49:47 | tainted_string | |
44-
| Taint externally controlled string | test.py:52 | test.py:52:23:52:36 | tainted_string | |
45-
| Taint externally controlled string | test.py:55 | test.py:55:22:55:28 | TAINTED | |
46-
| Taint externally controlled string | test.py:56 | test.py:56:9:56:27 | str() | |
47-
| Taint externally controlled string | test.py:56 | test.py:56:13:56:26 | tainted_string | |
48-
| Taint externally controlled string | test.py:57 | test.py:57:9:57:29 | bytes() | |
49-
| Taint externally controlled string | test.py:57 | test.py:57:15:57:28 | tainted_string | |
50-
| Taint externally controlled string | test.py:58 | test.py:58:9:58:46 | bytes() | |
51-
| Taint externally controlled string | test.py:58 | test.py:58:15:58:28 | tainted_string | |
40+
| Taint externally controlled string | test.py:39 | test.py:39:21:39:34 | tainted_string | |
41+
| Taint externally controlled string | test.py:40 | test.py:40:22:40:35 | tainted_string | |
42+
| Taint externally controlled string | test.py:41 | test.py:41:28:41:41 | tainted_string | |
43+
| Taint externally controlled string | test.py:44 | test.py:44:22:44:28 | TAINTED | |
44+
| Taint externally controlled string | test.py:45 | test.py:45:8:45:21 | tainted_string | |
45+
| Taint externally controlled string | test.py:48 | test.py:48:23:48:36 | tainted_string | |
46+
| Taint externally controlled string | test.py:51 | test.py:51:22:51:28 | TAINTED | |
47+
| Taint externally controlled string | test.py:52 | test.py:52:8:52:21 | tainted_string | |
48+
| Taint externally controlled string | test.py:52 | test.py:52:34:52:47 | tainted_string | |
49+
| Taint externally controlled string | test.py:55 | test.py:55:23:55:36 | tainted_string | |
50+
| Taint externally controlled string | test.py:58 | test.py:58:22:58:28 | TAINTED | |
51+
| Taint externally controlled string | test.py:59 | test.py:59:9:59:27 | str() | |
52+
| Taint externally controlled string | test.py:59 | test.py:59:13:59:26 | tainted_string | |
53+
| Taint externally controlled string | test.py:60 | test.py:60:9:60:29 | bytes() | |
54+
| Taint externally controlled string | test.py:60 | test.py:60:15:60:28 | tainted_string | |
55+
| Taint externally controlled string | test.py:61 | test.py:61:9:61:46 | bytes() | |
56+
| Taint externally controlled string | test.py:61 | test.py:61:15:61:28 | tainted_string | |
5257
| Taint json[externally controlled string] | test.py:6 | test.py:6:20:6:45 | Attribute() | |
5358
| Taint json[externally controlled string] | test.py:7 | test.py:7:9:7:20 | tainted_json | |
5459
| Taint json[externally controlled string] | test.py:7 | test.py:7:9:7:25 | Subscript | |
@@ -63,3 +68,4 @@
6368
| Taint {externally controlled string} | test.py:23 | test.py:23:9:23:27 | Attribute() | |
6469
| Taint {externally controlled string} | test.py:24 | test.py:24:14:24:25 | tainted_dict | |
6570
| Taint {externally controlled string} | test.py:27 | test.py:27:17:27:28 | tainted_dict | |
71+
| Taint {externally controlled string} | test.py:41 | test.py:41:20:41:42 | Dict | |

python/ql/test/library-tests/taint/strings/TestStep.expected

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,30 @@
2020
| Taint externally controlled string | test.py:31 | test.py:31:22:31:28 | TAINTED | | --> | Taint externally controlled string | test.py:36 | test.py:36:18:36:31 | tainted_string | |
2121
| Taint externally controlled string | test.py:31 | test.py:31:22:31:28 | TAINTED | | --> | Taint externally controlled string | test.py:37 | test.py:37:14:37:27 | tainted_string | |
2222
| Taint externally controlled string | test.py:31 | test.py:31:22:31:28 | TAINTED | | --> | Taint externally controlled string | test.py:38 | test.py:38:9:38:22 | tainted_string | |
23+
| Taint externally controlled string | test.py:31 | test.py:31:22:31:28 | TAINTED | | --> | Taint externally controlled string | test.py:39 | test.py:39:21:39:34 | tainted_string | |
24+
| Taint externally controlled string | test.py:31 | test.py:31:22:31:28 | TAINTED | | --> | Taint externally controlled string | test.py:40 | test.py:40:22:40:35 | tainted_string | |
25+
| Taint externally controlled string | test.py:31 | test.py:31:22:31:28 | TAINTED | | --> | Taint externally controlled string | test.py:41 | test.py:41:28:41:41 | tainted_string | |
2326
| Taint externally controlled string | test.py:32 | test.py:32:9:32:22 | tainted_string | | --> | Taint externally controlled string | test.py:32 | test.py:32:9:32:31 | Attribute() | |
2427
| Taint externally controlled string | test.py:33 | test.py:33:9:33:22 | tainted_string | | --> | Taint externally controlled string | test.py:33 | test.py:33:9:33:29 | Attribute() | |
2528
| Taint externally controlled string | test.py:34 | test.py:34:9:34:22 | tainted_string | | --> | Taint externally controlled string | test.py:34 | test.py:34:9:34:25 | Subscript | |
2629
| Taint externally controlled string | test.py:35 | test.py:35:9:35:22 | tainted_string | | --> | Taint externally controlled string | test.py:35 | test.py:35:9:35:27 | Subscript | |
2730
| Taint externally controlled string | test.py:36 | test.py:36:18:36:31 | tainted_string | | --> | Taint externally controlled string | test.py:36 | test.py:36:9:36:32 | reversed() | |
2831
| Taint externally controlled string | test.py:37 | test.py:37:14:37:27 | tainted_string | | --> | Taint externally controlled string | test.py:37 | test.py:37:9:37:28 | copy() | |
2932
| Taint externally controlled string | test.py:38 | test.py:38:9:38:22 | tainted_string | | --> | Taint externally controlled string | test.py:38 | test.py:38:9:38:30 | Attribute() | |
30-
| Taint externally controlled string | test.py:41 | test.py:41:22:41:28 | TAINTED | | --> | Taint externally controlled string | test.py:42 | test.py:42:8:42:21 | tainted_string | |
31-
| Taint externally controlled string | test.py:41 | test.py:41:22:41:28 | TAINTED | | --> | Taint externally controlled string | test.py:45 | test.py:45:23:45:36 | tainted_string | |
32-
| Taint externally controlled string | test.py:48 | test.py:48:22:48:28 | TAINTED | | --> | Taint externally controlled string | test.py:49 | test.py:49:8:49:21 | tainted_string | |
33-
| Taint externally controlled string | test.py:48 | test.py:48:22:48:28 | TAINTED | | --> | Taint externally controlled string | test.py:49 | test.py:49:34:49:47 | tainted_string | |
34-
| Taint externally controlled string | test.py:48 | test.py:48:22:48:28 | TAINTED | | --> | Taint externally controlled string | test.py:52 | test.py:52:23:52:36 | tainted_string | |
35-
| Taint externally controlled string | test.py:55 | test.py:55:22:55:28 | TAINTED | | --> | Taint externally controlled string | test.py:56 | test.py:56:13:56:26 | tainted_string | |
36-
| Taint externally controlled string | test.py:55 | test.py:55:22:55:28 | TAINTED | | --> | Taint externally controlled string | test.py:57 | test.py:57:15:57:28 | tainted_string | |
37-
| Taint externally controlled string | test.py:55 | test.py:55:22:55:28 | TAINTED | | --> | Taint externally controlled string | test.py:58 | test.py:58:15:58:28 | tainted_string | |
38-
| Taint externally controlled string | test.py:56 | test.py:56:13:56:26 | tainted_string | | --> | Taint externally controlled string | test.py:56 | test.py:56:9:56:27 | str() | |
39-
| Taint externally controlled string | test.py:57 | test.py:57:15:57:28 | tainted_string | | --> | Taint externally controlled string | test.py:57 | test.py:57:9:57:29 | bytes() | |
40-
| Taint externally controlled string | test.py:58 | test.py:58:15:58:28 | tainted_string | | --> | Taint externally controlled string | test.py:58 | test.py:58:9:58:46 | bytes() | |
33+
| Taint externally controlled string | test.py:39 | test.py:39:21:39:34 | tainted_string | | --> | Taint [externally controlled string] | test.py:39 | test.py:39:20:39:35 | List | |
34+
| Taint externally controlled string | test.py:40 | test.py:40:22:40:35 | tainted_string | | --> | Taint [externally controlled string] | test.py:40 | test.py:40:22:40:36 | Tuple | |
35+
| Taint externally controlled string | test.py:41 | test.py:41:28:41:41 | tainted_string | | --> | Taint {externally controlled string} | test.py:41 | test.py:41:20:41:42 | Dict | |
36+
| Taint externally controlled string | test.py:44 | test.py:44:22:44:28 | TAINTED | | --> | Taint externally controlled string | test.py:45 | test.py:45:8:45:21 | tainted_string | |
37+
| Taint externally controlled string | test.py:44 | test.py:44:22:44:28 | TAINTED | | --> | Taint externally controlled string | test.py:48 | test.py:48:23:48:36 | tainted_string | |
38+
| Taint externally controlled string | test.py:51 | test.py:51:22:51:28 | TAINTED | | --> | Taint externally controlled string | test.py:52 | test.py:52:8:52:21 | tainted_string | |
39+
| Taint externally controlled string | test.py:51 | test.py:51:22:51:28 | TAINTED | | --> | Taint externally controlled string | test.py:52 | test.py:52:34:52:47 | tainted_string | |
40+
| Taint externally controlled string | test.py:51 | test.py:51:22:51:28 | TAINTED | | --> | Taint externally controlled string | test.py:55 | test.py:55:23:55:36 | tainted_string | |
41+
| Taint externally controlled string | test.py:58 | test.py:58:22:58:28 | TAINTED | | --> | Taint externally controlled string | test.py:59 | test.py:59:13:59:26 | tainted_string | |
42+
| Taint externally controlled string | test.py:58 | test.py:58:22:58:28 | TAINTED | | --> | Taint externally controlled string | test.py:60 | test.py:60:15:60:28 | tainted_string | |
43+
| Taint externally controlled string | test.py:58 | test.py:58:22:58:28 | TAINTED | | --> | Taint externally controlled string | test.py:61 | test.py:61:15:61:28 | tainted_string | |
44+
| Taint externally controlled string | test.py:59 | test.py:59:13:59:26 | tainted_string | | --> | Taint externally controlled string | test.py:59 | test.py:59:9:59:27 | str() | |
45+
| Taint externally controlled string | test.py:60 | test.py:60:15:60:28 | tainted_string | | --> | Taint externally controlled string | test.py:60 | test.py:60:9:60:29 | bytes() | |
46+
| Taint externally controlled string | test.py:61 | test.py:61:15:61:28 | tainted_string | | --> | Taint externally controlled string | test.py:61 | test.py:61:9:61:46 | bytes() | |
4147
| Taint json[externally controlled string] | test.py:6 | test.py:6:20:6:45 | Attribute() | | --> | Taint json[externally controlled string] | test.py:7 | test.py:7:9:7:20 | tainted_json | |
4248
| Taint json[externally controlled string] | test.py:7 | test.py:7:9:7:20 | tainted_json | | --> | Taint externally controlled string | test.py:7 | test.py:7:9:7:25 | Subscript | |
4349
| Taint json[externally controlled string] | test.py:7 | test.py:7:9:7:20 | tainted_json | | --> | Taint json[externally controlled string] | test.py:7 | test.py:7:9:7:25 | Subscript | |

python/ql/test/library-tests/taint/strings/test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def test_str():
3636
e = reversed(tainted_string)
3737
f = copy(tainted_string)
3838
h = tainted_string.strip()
39+
tainted_list = [tainted_string]
40+
tainted_tuple = (tainted_string,)
41+
tainted_dict = {'key': tainted_string}
3942

4043
def test_const_sanitizer1():
4144
tainted_string = TAINTED

0 commit comments

Comments
 (0)