Ruby: Add reorder as a SQL sink

In recent versions of Rails this method doesn't seem to be vulnerable,
but it may be in previous versions. There's a slight FP risk here, but
I think it is small.
This commit is contained in:
Harry Maclean
2023-03-13 08:38:17 +13:00
parent ab58d4c11f
commit c97dccf0de
3 changed files with 27 additions and 21 deletions

View File

@@ -116,8 +116,8 @@ private Expr sqlFragmentArgument(MethodCall call) {
[
"delete_all", "delete_by", "destroy_all", "destroy_by", "exists?", "find_by", "find_by!",
"find_or_create_by", "find_or_create_by!", "find_or_initialize_by", "find_by_sql", "from",
"group", "having", "joins", "lock", "not", "order", "pluck", "where", "rewhere", "select",
"reselect", "update_all"
"group", "having", "joins", "lock", "not", "order", "reorder", "pluck", "where",
"rewhere", "select", "reselect", "update_all"
] and
result = call.getArgument(0)
or