File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
lib/codeql/ruby/frameworks
test/library-tests/frameworks Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,9 @@ module PosixSpawn {
6262 // is shell interpreted unless there is another argument with a string
6363 // constant value.
6464 override predicate isShellInterpreted ( DataFlow:: Node arg ) {
65+ this .argument ( arg ) and
6566 not exists ( DataFlow:: Node otherArg |
6667 otherArg != arg and
67- this .argument ( arg ) and
6868 this .argument ( otherArg ) and
6969 otherArg .asExpr ( ) .getConstantValue ( ) .isString ( _)
7070 )
Original file line number Diff line number Diff line change @@ -5,11 +5,13 @@ import codeql.ruby.DataFlow
55query predicate systemCalls (
66 PosixSpawn:: SystemCall call , DataFlow:: Node arg , boolean shellInterpreted
77) {
8- arg = call .getAnArgument ( ) and
9- if call .isShellInterpreted ( arg ) then shellInterpreted = true else shellInterpreted = false
8+ call .isShellInterpreted ( arg ) and shellInterpreted = true
9+ or
10+ not call .isShellInterpreted ( arg ) and arg = call .getAnArgument ( ) and shellInterpreted = false
1011}
1112
1213query predicate childCalls ( PosixSpawn:: ChildCall call , DataFlow:: Node arg , boolean shellInterpreted ) {
13- arg = call .getAnArgument ( ) and
14- if call .isShellInterpreted ( arg ) then shellInterpreted = true else shellInterpreted = false
14+ call .isShellInterpreted ( arg ) and shellInterpreted = true
15+ or
16+ not call .isShellInterpreted ( arg ) and arg = call .getAnArgument ( ) and shellInterpreted = false
1517}
You can’t perform that action at this time.
0 commit comments