File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
python/ql/src/experimental/Security/CWE-022bis Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -100,22 +100,15 @@ class Configuration extends TaintTracking::Configuration {
100
100
}
101
101
102
102
override predicate isAdditionalTaintStep ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
103
- exists ( AttrRead attr , MethodCallNode call |
104
- attr .accesses ( nodeFrom , "getmembers" ) and
105
- nodeFrom = call .getObject ( ) and
106
- nodeFrom instanceof AllTarfileOpens and
107
- nodeTo = call
108
- )
103
+ nodeTo .( MethodCallNode ) .calls ( nodeFrom , "getmembers" ) and
104
+ nodeFrom instanceof AllTarfileOpens
109
105
or
110
106
// To handle the case of `with closing(tarfile.open()) as file:`
111
107
// we add a step from the first argument of `closing` to the call to `closing`,
112
108
// whenever that first argument is a return of `tarfile.open()`.
113
- exists ( API:: CallNode closing |
114
- closing = API:: moduleImport ( "contextlib" ) .getMember ( "closing" ) .getACall ( ) and
115
- nodeFrom = closing .getArg ( 0 ) and
116
- nodeFrom = tarfileOpen ( ) .getReturn ( ) .getAValueReachableFromSource ( ) and
117
- nodeTo = closing
118
- )
109
+ nodeTo = API:: moduleImport ( "contextlib" ) .getMember ( "closing" ) .getACall ( ) and
110
+ nodeFrom = nodeTo .( API:: CallNode ) .getArg ( 0 ) and
111
+ nodeFrom = tarfileOpen ( ) .getReturn ( ) .getAValueReachableFromSource ( )
119
112
}
120
113
}
121
114
You can’t perform that action at this time.
0 commit comments