@@ -66,8 +66,14 @@ class UnsafeUnpackingConfig extends TaintTracking::Configuration {
66
66
or
67
67
// Open a file for access
68
68
exists ( MethodCallNode cn |
69
- nodeTo = cn .getObject ( ) and
70
- cn .getMethodName ( ) = "open" and
69
+ cn .calls ( nodeTo , "open" ) and
70
+ cn .flowsTo ( nodeFrom )
71
+ )
72
+ or
73
+ // Open a file for access using builtin
74
+ exists ( API:: CallNode cn |
75
+ cn = API:: builtin ( "open" ) .getACall ( ) and
76
+ nodeTo = cn .( API:: CallNode ) .getArg ( 0 ) and
71
77
cn .flowsTo ( nodeFrom )
72
78
)
73
79
or
@@ -77,22 +83,11 @@ class UnsafeUnpackingConfig extends TaintTracking::Configuration {
77
83
nodeFrom = cn .getArg ( 0 )
78
84
)
79
85
or
80
- // Open a file for access using builtin
81
- nodeFrom = API:: builtin ( "open" ) .getACall ( ) and nodeTo = nodeFrom .( API:: CallNode ) .getArg ( 0 )
82
- or
83
86
// Retrieve Django uploaded files
84
87
// see getlist(): https://docs.djangoproject.com/en/4.1/ref/request-response/#django.http.QueryDict.getlist
85
88
// see chunks(): https://docs.djangoproject.com/en/4.1/ref/files/uploads/#django.core.files.uploadedfile.UploadedFile.chunks
86
89
nodeTo .( MethodCallNode ) .calls ( nodeFrom , [ "getlist" , "get" , "chunks" ] )
87
90
or
88
- // Writing the response data to the archive
89
- exists ( Stdlib:: FileLikeObject:: InstanceSource is , Node f , MethodCallNode mc |
90
- is .flowsTo ( f ) and
91
- mc .calls ( f , "write" ) and
92
- nodeFrom = mc .getArg ( 0 ) and
93
- nodeTo = is .( CallCfgNode ) .getArg ( 0 )
94
- )
95
- or
96
91
// Considering the use of "fs"
97
92
exists ( API:: CallNode fs , MethodCallNode mcn |
98
93
fs =
0 commit comments