@@ -66,8 +66,14 @@ class UnsafeUnpackingConfig extends TaintTracking::Configuration {
6666 or
6767 // Open a file for access
6868 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
7177 cn .flowsTo ( nodeFrom )
7278 )
7379 or
@@ -77,22 +83,11 @@ class UnsafeUnpackingConfig extends TaintTracking::Configuration {
7783 nodeFrom = cn .getArg ( 0 )
7884 )
7985 or
80- // Open a file for access using builtin
81- nodeFrom = API:: builtin ( "open" ) .getACall ( ) and nodeTo = nodeFrom .( API:: CallNode ) .getArg ( 0 )
82- or
8386 // Retrieve Django uploaded files
8487 // see getlist(): https://docs.djangoproject.com/en/4.1/ref/request-response/#django.http.QueryDict.getlist
8588 // see chunks(): https://docs.djangoproject.com/en/4.1/ref/files/uploads/#django.core.files.uploadedfile.UploadedFile.chunks
8689 nodeTo .( MethodCallNode ) .calls ( nodeFrom , [ "getlist" , "get" , "chunks" ] )
8790 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
9691 // Considering the use of "fs"
9792 exists ( API:: CallNode fs , MethodCallNode mcn |
9893 fs =
0 commit comments