mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Merge branch 'main' into experimental-strong-params
This commit is contained in:
@@ -5,11 +5,13 @@ import codeql.ruby.DataFlow
|
||||
query predicate systemCalls(
|
||||
PosixSpawn::SystemCall call, DataFlow::Node arg, boolean shellInterpreted
|
||||
) {
|
||||
arg = call.getAnArgument() and
|
||||
if call.isShellInterpreted(arg) then shellInterpreted = true else shellInterpreted = false
|
||||
call.isShellInterpreted(arg) and shellInterpreted = true
|
||||
or
|
||||
not call.isShellInterpreted(arg) and arg = call.getAnArgument() and shellInterpreted = false
|
||||
}
|
||||
|
||||
query predicate childCalls(PosixSpawn::ChildCall call, DataFlow::Node arg, boolean shellInterpreted) {
|
||||
arg = call.getAnArgument() and
|
||||
if call.isShellInterpreted(arg) then shellInterpreted = true else shellInterpreted = false
|
||||
call.isShellInterpreted(arg) and shellInterpreted = true
|
||||
or
|
||||
not call.isShellInterpreted(arg) and arg = call.getAnArgument() and shellInterpreted = false
|
||||
}
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
systemCommandExecutions
|
||||
| Railties.rb:5:5:5:34 | call to execute_command |
|
||||
| Railties.rb:6:5:6:37 | call to execute_command |
|
||||
| Railties.rb:8:5:8:16 | call to rake |
|
||||
| Railties.rb:10:5:10:27 | call to rails_command |
|
||||
| Railties.rb:12:5:12:17 | call to git |
|
||||
shellInterpretedArguments
|
||||
| Railties.rb:5:5:5:34 | call to execute_command | Railties.rb:5:21:5:25 | :rake |
|
||||
| Railties.rb:5:5:5:34 | call to execute_command | Railties.rb:5:28:5:33 | "test" |
|
||||
| Railties.rb:6:5:6:37 | call to execute_command | Railties.rb:6:21:6:26 | :rails |
|
||||
| Railties.rb:6:5:6:37 | call to execute_command | Railties.rb:6:29:6:36 | "server" |
|
||||
| Railties.rb:8:5:8:16 | call to rake | Railties.rb:8:10:8:15 | "test" |
|
||||
| Railties.rb:10:5:10:27 | call to rails_command | Railties.rb:10:19:10:26 | "server" |
|
||||
| Railties.rb:12:5:12:17 | call to git | Railties.rb:12:9:12:16 | "status" |
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
private import ruby
|
||||
private import codeql.ruby.Concepts
|
||||
private import codeql.ruby.frameworks.Railties
|
||||
private import codeql.ruby.DataFlow
|
||||
|
||||
query predicate systemCommandExecutions(SystemCommandExecution e) { any() }
|
||||
|
||||
query predicate shellInterpretedArguments(SystemCommandExecution e, DataFlow::Node arg) {
|
||||
e.isShellInterpreted(arg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user