Identify more vulnerable ActiveRecord methods

`find_by!`, `find_or_create_by`, `find_or_create_by!` and
`find_or_initialize_by` act similarly to `find_by`.
This commit is contained in:
Harry Maclean
2021-09-29 10:49:14 +01:00
parent 56919eee0b
commit 270d13e4ac
3 changed files with 19 additions and 10 deletions

View File

@@ -68,7 +68,8 @@ private Expr sqlFragmentArgument(MethodCall call) {
(
methodName =
[
"delete_by", "destroy_by", "exists?", "find_by", "find_by_sql", "from", "group", "having",
"delete_by", "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"
] and
result = call.getArgument(0)