File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
python/ql/lib/semmle/python/security/dataflow Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -84,26 +84,19 @@ module TarSlip {
84
84
* A sink capturing method calls to `extractall`.
85
85
*
86
86
* For a call to `file.extractall`, `file` is considered a sink if
87
- *
88
- * - there are no other arguments, or
89
- * - there are other arguments (except `members`), and the extraction filter is unsafe.
87
+ * there is no `members` argument and the extraction filter is unsafe.
90
88
*/
91
89
class ExtractAllSink extends Sink {
92
90
ExtractAllSink ( ) {
93
- exists ( DataFlow :: CallCfgNode call |
91
+ exists ( API :: CallNode call |
94
92
call =
95
93
API:: moduleImport ( "tarfile" )
96
94
.getMember ( "open" )
97
95
.getReturn ( )
98
96
.getMember ( "extractall" )
99
97
.getACall ( ) and
100
- (
101
- not exists ( call .getArg ( _) ) and
102
- not exists ( call .getArgByName ( _) )
103
- or
104
- hasUnsafeFilter ( call )
105
- ) and
106
- not exists ( call .getArgByName ( "members" ) ) and
98
+ hasUnsafeFilter ( call ) and
99
+ not exists ( call .getParameter ( 2 , "members" ) ) and
107
100
this = call .( DataFlow:: MethodCallNode ) .getObject ( )
108
101
)
109
102
}
You can’t perform that action at this time.
0 commit comments