File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
python/ql/src/experimental/Security Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -61,18 +61,15 @@ class UnsafeUnpackingConfig extends TaintTracking::Configuration {
61
61
}
62
62
63
63
override predicate isAdditionalTaintStep ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
64
- // Open for access
64
+ // Open a file for access
65
65
exists ( MethodCallNode cn |
66
66
nodeTo = cn .getObject ( ) and
67
67
cn .getMethodName ( ) = "open" and
68
68
cn .flowsTo ( nodeFrom )
69
69
)
70
70
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 )
76
73
or
77
74
// Retrieve Django uploaded files
78
75
// 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 {
100
97
nodeTo = mcn
101
98
)
102
99
or
103
- //Use of join of filename
100
+ // Join the base_dir to the filename
104
101
nodeTo = API:: moduleImport ( "os" ) .getMember ( "path" ) .getMember ( "join" ) .getACall ( ) and
105
102
nodeFrom = nodeTo .( API:: CallNode ) .getArg ( 1 )
106
103
or
You can’t perform that action at this time.
0 commit comments