mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
add failing test for safe-ish uses of Object.send
This commit is contained in:
@@ -10,6 +10,7 @@ edges
|
||||
| CodeInjection.rb:38:24:38:27 | code : | CodeInjection.rb:38:10:38:28 | call to escape |
|
||||
| CodeInjection.rb:78:12:78:17 | call to params : | CodeInjection.rb:78:12:78:24 | ...[...] : |
|
||||
| CodeInjection.rb:78:12:78:24 | ...[...] : | CodeInjection.rb:80:16:80:19 | code |
|
||||
| CodeInjection.rb:78:12:78:24 | ...[...] : | CodeInjection.rb:82:16:82:43 | ... + ... |
|
||||
nodes
|
||||
| CodeInjection.rb:5:12:5:17 | call to params : | semmle.label | call to params : |
|
||||
| CodeInjection.rb:5:12:5:24 | ...[...] : | semmle.label | ...[...] : |
|
||||
@@ -25,6 +26,7 @@ nodes
|
||||
| CodeInjection.rb:78:12:78:17 | call to params : | semmle.label | call to params : |
|
||||
| CodeInjection.rb:78:12:78:24 | ...[...] : | semmle.label | ...[...] : |
|
||||
| CodeInjection.rb:80:16:80:19 | code | semmle.label | code |
|
||||
| CodeInjection.rb:82:16:82:43 | ... + ... | semmle.label | ... + ... |
|
||||
subpaths
|
||||
#select
|
||||
| CodeInjection.rb:8:10:8:13 | code | CodeInjection.rb:5:12:5:17 | call to params : | CodeInjection.rb:8:10:8:13 | code | This code execution depends on a $@. | CodeInjection.rb:5:12:5:17 | call to params | user-provided value |
|
||||
@@ -36,3 +38,4 @@ subpaths
|
||||
| CodeInjection.rb:38:10:38:28 | call to escape | CodeInjection.rb:5:12:5:17 | call to params : | CodeInjection.rb:38:10:38:28 | call to escape | This code execution depends on a $@. | CodeInjection.rb:5:12:5:17 | call to params | user-provided value |
|
||||
| CodeInjection.rb:41:40:41:43 | code | CodeInjection.rb:5:12:5:17 | call to params : | CodeInjection.rb:41:40:41:43 | code | This code execution depends on a $@. | CodeInjection.rb:5:12:5:17 | call to params | user-provided value |
|
||||
| CodeInjection.rb:80:16:80:19 | code | CodeInjection.rb:78:12:78:17 | call to params : | CodeInjection.rb:80:16:80:19 | code | This code execution depends on a $@. | CodeInjection.rb:78:12:78:17 | call to params | user-provided value |
|
||||
| CodeInjection.rb:82:16:82:43 | ... + ... | CodeInjection.rb:78:12:78:17 | call to params : | CodeInjection.rb:82:16:82:43 | ... + ... | This code execution depends on a $@. | CodeInjection.rb:78:12:78:17 | call to params | user-provided value |
|
||||
|
||||
@@ -78,5 +78,7 @@ class UsersController < ActionController::Base
|
||||
code = params[:code]
|
||||
|
||||
obj().send(code, "foo"); # BAD
|
||||
|
||||
obj().send("prefix_" + code + "_suffix", "foo"); # GOOD - but still flagged by this query
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user