mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
remove parameters named "code" as source
This commit is contained in:
@@ -19,7 +19,10 @@ module UnsafeCodeConstruction {
|
||||
|
||||
/** An input parameter to a gem seen as a source. */
|
||||
private class LibraryInputAsSource extends Source instanceof DataFlow::ParameterNode {
|
||||
LibraryInputAsSource() { this = Gem::getALibraryInput() }
|
||||
LibraryInputAsSource() {
|
||||
this = Gem::getALibraryInput() and
|
||||
not this.getName() = "code"
|
||||
}
|
||||
}
|
||||
|
||||
/** A sink for code constructed from library input vulnerabilities. */
|
||||
|
||||
@@ -20,4 +20,8 @@ class Foobar
|
||||
def send_stuff(x)
|
||||
foo.send("foo_#{x}") # OK - attacker cannot control entire string.
|
||||
end
|
||||
|
||||
def named_code(code)
|
||||
foo.send("def \n #{code} \n end") # OK - parameter is named code
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user