mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Merge pull request #10968 from erik-krogh/fixRbCode
RB: fix rb/code-injection
This commit is contained in:
@@ -15,7 +15,12 @@ edges
|
||||
| CodeInjection.rb:38:24:38:27 | code : | CodeInjection.rb:38:10:38:28 | call to escape |
|
||||
| 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: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:86:10:86:37 | ... + ... |
|
||||
| CodeInjection.rb:78:12:78:24 | ...[...] : | CodeInjection.rb:88:10:88:32 | "prefix_#{...}_suffix" |
|
||||
| CodeInjection.rb:78:12:78:24 | ...[...] : | CodeInjection.rb:90:10:90:13 | code |
|
||||
| CodeInjection.rb:78:12:78:24 | ...[...] : | CodeInjection.rb:90:10:90:13 | code |
|
||||
nodes
|
||||
| CodeInjection.rb:5:12:5:17 | call to params : | semmle.label | call to params : |
|
||||
| CodeInjection.rb:5:12:5:17 | call to params : | semmle.label | call to params : |
|
||||
@@ -37,8 +42,14 @@ nodes
|
||||
| CodeInjection.rb:38:24:38:27 | code : | semmle.label | code : |
|
||||
| CodeInjection.rb:41:40:41:43 | code | semmle.label | code |
|
||||
| CodeInjection.rb:78:12:78:17 | call to params : | semmle.label | call to params : |
|
||||
| CodeInjection.rb:78:12:78:17 | call to params : | semmle.label | call to params : |
|
||||
| CodeInjection.rb:78:12:78:24 | ...[...] : | semmle.label | ...[...] : |
|
||||
| CodeInjection.rb:78:12:78:24 | ...[...] : | semmle.label | ...[...] : |
|
||||
| CodeInjection.rb:80:16:80:19 | code | semmle.label | code |
|
||||
| CodeInjection.rb:86:10:86:37 | ... + ... | semmle.label | ... + ... |
|
||||
| CodeInjection.rb:88:10:88:32 | "prefix_#{...}_suffix" | semmle.label | "prefix_#{...}_suffix" |
|
||||
| CodeInjection.rb:90:10:90:13 | code | semmle.label | code |
|
||||
| CodeInjection.rb:90:10:90:13 | code | semmle.label | code |
|
||||
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 |
|
||||
@@ -50,3 +61,6 @@ 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:86:10:86:37 | ... + ... | CodeInjection.rb:78:12:78:17 | call to params : | CodeInjection.rb:86:10:86:37 | ... + ... | This code execution depends on a $@. | CodeInjection.rb:78:12:78:17 | call to params | user-provided value |
|
||||
| CodeInjection.rb:88:10:88:32 | "prefix_#{...}_suffix" | CodeInjection.rb:78:12:78:17 | call to params : | CodeInjection.rb:88:10:88:32 | "prefix_#{...}_suffix" | This code execution depends on a $@. | CodeInjection.rb:78:12:78:17 | call to params | user-provided value |
|
||||
| CodeInjection.rb:90:10:90:13 | code | CodeInjection.rb:78:12:78:17 | call to params : | CodeInjection.rb:90:10:90:13 | code | This code execution depends on a $@. | CodeInjection.rb:78:12:78:17 | call to params | user-provided value |
|
||||
|
||||
@@ -82,5 +82,11 @@ class UsersController < ActionController::Base
|
||||
obj().send("prefix_" + code + "_suffix", "foo"); # GOOD
|
||||
|
||||
obj().send("prefix_#{code}_suffix", "foo"); # GOOD
|
||||
|
||||
eval("prefix_" + code + "_suffix"); # BAD
|
||||
|
||||
eval("prefix_#{code}_suffix"); # BAD
|
||||
|
||||
eval(code); # BAD
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user