File tree Expand file tree Collapse file tree
python/ql/src/experimental/Security Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,18 +61,15 @@ class UnsafeUnpackingConfig extends TaintTracking::Configuration {
6161 }
6262
6363 override predicate isAdditionalTaintStep ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
64- // Open for access
64+ // Open a file for access
6565 exists ( MethodCallNode cn |
6666 nodeTo = cn .getObject ( ) and
6767 cn .getMethodName ( ) = "open" and
6868 cn .flowsTo ( nodeFrom )
6969 )
7070 or
71- // Write for access
72- exists ( MethodCallNode cn |
73- cn .calls ( nodeFrom , "write" ) and
74- nodeTo = cn .getArg ( 0 )
75- )
71+ // Open a file for access using builtin
72+ nodeFrom = API:: builtin ( "open" ) .getACall ( ) and nodeTo = nodeFrom .( API:: CallNode ) .getArg ( 0 )
7673 or
7774 // Retrieve Django uploaded files
7875 // see getlist(): https://docs.djangoproject.com/en/4.1/ref/request-response/#django.http.QueryDict.getlist
@@ -100,7 +97,7 @@ class UnsafeUnpackingConfig extends TaintTracking::Configuration {
10097 nodeTo = mcn
10198 )
10299 or
103- //Use of join of filename
100+ // Join the base_dir to the filename
104101 nodeTo = API:: moduleImport ( "os" ) .getMember ( "path" ) .getMember ( "join" ) .getACall ( ) and
105102 nodeFrom = nodeTo .( API:: CallNode ) .getArg ( 1 )
106103 or
You can’t perform that action at this time.
0 commit comments