Open
Description
The proposed solutions do not work, as they rely on the no-longer existing user_id
parameter, throwing the following error:
Failure/Error: user = User.find(id: params[:user][:user_id])
ActiveRecord::RecordNotFound:
Couldn't find User with 'id'={:id=>nil}
Refactor these to be in the following syntax. Also note, we no longer need to specify the column name since we're searching on primary key :
user = User.find(params[:user][:id])
user = User.where("id = ?", params[:user][:id]).first
https://github.com/OWASP/railsgoat/wiki/R5-A1-SQL-Injection-Concatentation