Skip to content

Commit 367ee3e

Browse files
committed
Python: Modernise security/injection/Path.qll
And we're making things a bit more clean since it's not *any* argument of `open()` that is a taint-sink.
1 parent 6783788 commit 367ee3e

File tree

1 file changed

+6
-2
lines changed
  • python/ql/src/semmle/python/security/injection

1 file changed

+6
-2
lines changed

python/ql/src/semmle/python/security/injection/Path.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,12 @@ class OpenNode extends TaintSink {
6464

6565
OpenNode() {
6666
exists(CallNode call |
67-
call.getFunction().refersTo(Object::builtin("open")) and
68-
call.getAnArg() = this
67+
call = Value::named("open").getACall() and
68+
(
69+
call.getArg(0) = this
70+
or
71+
call.getArgByName("file") = this
72+
)
6973
)
7074
}
7175

0 commit comments

Comments
 (0)