REDHAT-BUG-966804: Medium severity Ruby on Rails Rails vulnerability
Ramon de C Valle (rcvalle) reports:
There is a mass assignment vulnerability in the create method of the UsersController controller.
The create method in app/controllers/userscontroller.rb deletes the user-controlled user[admin] parameter from the params hash but saves it to a local variable and assigns it to the newly created user object bypassing the :attrprotected mechanism.
def create admin = params[:user].delete :admin @user = User.new(params[:user]){|u| u.admin = admin } if @user.save @user.roles << Role.findbyname("Anonymous") unless @user.roles.map(&:name).include? "Anonymous" processsuccess else processerror end end
Any non-admin user with permissions to create other (non-admin) users (i.e. with Manager role) can create arbitrary admin users by sending a specially-crafted POST request.
Affected Software
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-966804?
The severity of REDHAT-BUG-966804 is classified as a high risk due to its mass assignment vulnerability.
How do I fix REDHAT-BUG-966804?
To fix REDHAT-BUG-966804, ensure that the user[admin] parameter is properly filtered and not accessible during the create action.
What versions of Ruby on Rails are affected by REDHAT-BUG-966804?
The vulnerability in REDHAT-BUG-966804 affects various versions of Ruby on Rails without specific version constraints provided.
What actions should I take if I am running an affected version related to REDHAT-BUG-966804?
If running an affected version related to REDHAT-BUG-966804, prioritize updating your application or implementing additional parameter filtering.
Can REDHAT-BUG-966804 lead to unauthorized access?
Yes, REDHAT-BUG-966804 can potentially lead to unauthorized access by allowing attackers to manipulate user parameters.