We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 664fdc3 commit 5fe62e2Copy full SHA for 5fe62e2
1 file changed
python/ql/src/experimental/Security/CWE-022bis/TarSlipImprov.ql
@@ -107,10 +107,13 @@ class Configuration extends TaintTracking::Configuration {
107
nodeTo = call
108
)
109
or
110
+ // To handle the case of `with closing(tarfile.open()) as file:`
111
+ // we add a step from the first argument of `closing` to the call to `closing`,
112
+ // 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
- nodeFrom = tarfileOpen().getReturn().getAValueReachingSink() and
116
+ nodeFrom = tarfileOpen().getReturn().getAValueReachableFromSource() and
117
nodeTo = closing
118
119
}
0 commit comments