mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
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.
This commit is contained in:
@@ -64,8 +64,12 @@ class OpenNode extends TaintSink {
|
||||
|
||||
OpenNode() {
|
||||
exists(CallNode call |
|
||||
call.getFunction().refersTo(Object::builtin("open")) and
|
||||
call.getAnArg() = this
|
||||
call = Value::named("open").getACall() and
|
||||
(
|
||||
call.getArg(0) = this
|
||||
or
|
||||
call.getArgByName("file") = this
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user