File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
src/semmle/python/security/strings
test/library-tests/taint/strings Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,9 @@ class ExternalFileObject extends TaintKind {
191
191
TaintKind getValue ( ) { result = valueKind }
192
192
193
193
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 ( )
195
197
}
196
198
}
197
199
Original file line number Diff line number Diff line change 68
68
| 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 | |
69
69
| 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 | |
70
70
| 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() | |
71
73
| 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 | |
72
74
| 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 | |
73
75
| 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 24
24
| test.py:69 | test_urlsplit_urlparse | urlsplit_res | [externally controlled string] |
25
25
| test.py:74 | test_tainted_file | tainted_file | file[externally controlled string] |
26
26
| 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] |
29
29
| test.py:78 | test_tainted_file | ListComp | NO TAINT |
You can’t perform that action at this time.
0 commit comments