Skip to content

Commit 186205b

Browse files
committed
add a test for explicit shell invocations using Kernel.open
1 parent de3b15e commit 186205b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ruby/ql/test/query-tests/security/cwe-078/NonConstantKernelOpen/NonConstantKernelOpen.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ def create
1717
Kernel.open("this is #{fine}") # GOOD
1818

1919
Kernel.open("#{this_is} bad") # BAD
20+
21+
open("| #{this_is_an_explicit_command} foo bar") # GOOD
2022
end
2123
end

0 commit comments

Comments
 (0)