File tree Expand file tree Collapse file tree
src/semmle/python/security/strings
test/library-tests/taint/strings Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,7 +191,9 @@ class ExternalFileObject extends TaintKind {
191191 TaintKind getValue ( ) { result = valueKind }
192192
193193 override TaintKind getTaintOfMethodResult ( string name ) {
194- name = "read" and result = this .getValue ( )
194+ name in [ "read" , "readline" ] and result = this .getValue ( )
195+ or
196+ name = "readlines" and result .( SequenceKind ) .getItem ( ) = this .getValue ( )
195197 }
196198}
197199
Original file line number Diff line number Diff line change 6868| Taint file[externally controlled string] | test.py:72 | test.py:72:20:72:31 | TAINTED_FILE | | --> | Taint file[externally controlled string] | test.py:77 | test.py:77:9:77:20 | tainted_file | |
6969| Taint file[externally controlled string] | test.py:72 | test.py:72:20:72:31 | TAINTED_FILE | | --> | Taint file[externally controlled string] | test.py:78 | test.py:78:27:78:38 | tainted_file | |
7070| Taint file[externally controlled string] | test.py:75 | test.py:75:9:75:20 | tainted_file | | --> | Taint externally controlled string | test.py:75 | test.py:75:9:75:27 | Attribute() | |
71+ | Taint file[externally controlled string] | test.py:76 | test.py:76:9:76:20 | tainted_file | | --> | Taint externally controlled string | test.py:76 | test.py:76:9:76:31 | Attribute() | |
72+ | Taint file[externally controlled string] | test.py:77 | test.py:77:9:77:20 | tainted_file | | --> | Taint [externally controlled string] | test.py:77 | test.py:77:9:77:32 | Attribute() | |
7173| 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 | |
7274| 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 | |
7375| 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 | |
Original file line number Diff line number Diff line change 2424| test.py:69 | test_urlsplit_urlparse | urlsplit_res | [externally controlled string] |
2525| test.py:74 | test_tainted_file | tainted_file | file[externally controlled string] |
2626| test.py:75 | test_tainted_file | Attribute() | externally controlled string |
27- | test.py:76 | test_tainted_file | Attribute() | NO TAINT |
28- | test.py:77 | test_tainted_file | Attribute() | NO TAINT |
27+ | test.py:76 | test_tainted_file | Attribute() | externally controlled string |
28+ | test.py:77 | test_tainted_file | Attribute() | [externally controlled string] |
2929| test.py:78 | test_tainted_file | ListComp | NO TAINT |
You can’t perform that action at this time.
0 commit comments