File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
python/ql/test/library-tests/taint/namedtuple Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 55| test.py:13 | test_basic | urlsplit_res | [externally controlled string] |
66| test.py:20 | test_sanitizer | Attribute | NO TAINT |
77| test.py:23 | test_sanitizer | Subscript | NO TAINT |
8- | test.py:33 | test_namedtuple | a | NO TAINT |
9- | test.py:33 | test_namedtuple | b | NO TAINT |
10- | test.py:33 | test_namedtuple | c | NO TAINT |
11- | test.py:33 | test_namedtuple | d | NO TAINT |
8+ | test.py:26 | test_sanitizer | Attribute | NO TAINT |
9+ | test.py:29 | test_sanitizer | Attribute | externally controlled string |
10+ | test.py:32 | test_sanitizer | Attribute | externally controlled string |
11+ | test.py:42 | test_namedtuple | a | NO TAINT |
12+ | test.py:42 | test_namedtuple | b | NO TAINT |
13+ | test.py:42 | test_namedtuple | c | NO TAINT |
14+ | test.py:42 | test_namedtuple | d | NO TAINT |
Original file line number Diff line number Diff line change @@ -22,6 +22,15 @@ def test_sanitizer():
2222 if urlsplit_res [2 ] == "OK" :
2323 test (urlsplit_res [0 ])
2424
25+ if urlsplit_res .netloc == "OK" :
26+ test (urlsplit_res .path ) # FN
27+
28+ if urlsplit_res .netloc in ["OK" ]:
29+ test (urlsplit_res .netloc ) # FP
30+
31+ if urlsplit_res .netloc in ["OK" , non_constant ()]:
32+ test (urlsplit_res .netloc ) # should be tainted
33+
2534def test_namedtuple ():
2635 tainted_string = TAINTED_STRING
2736 Point = namedtuple ('Point' , ['x' , 'y' ])
You can’t perform that action at this time.
0 commit comments