Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Strong Params #27

Closed
liveh2o opened this issue Feb 11, 2015 · 5 comments
Closed

Add support for Strong Params #27

liveh2o opened this issue Feb 11, 2015 · 5 comments

Comments

@liveh2o
Copy link
Owner

liveh2o commented Feb 11, 2015

Active Record now enforces attribute whitelisting through Strong Params, but ARem doesn't support it. It should.

@liveh2o
Copy link
Owner Author

liveh2o commented Feb 26, 2015

Not actually an issue. Active Record has nothing to do with Strong Params.

@liveh2o liveh2o closed this as completed Feb 26, 2015
@brianstien
Copy link
Collaborator

This is still a problem, here is an example

class User < ::ActiveRecord::Base
end

UsersController < ::ApplicationController::Base
  def update
    @user = User.find(params[:id])
    @user.update_attributes(params[:user]) # raises ActiveModel::ForbiddenAttributes because params have not been sanitized with strong params
  end
end
class User < ::ActiveRemote::Base
end

UsersController < ::ApplicationController::Base
  def update
    @user = User.find(params[:id])
    @user.update_attributes(params[:user]) # does not raise an error, allows mass assignment vulnerability
  end
end

@brianstien
Copy link
Collaborator

I think we need to include ActiveModel::ForbiddenAttributesProtection into ActiveRemote::Base

https://github.com/cgriego/active_attr#massassignment

@liveh2o liveh2o reopened this Jul 14, 2015
@liveh2o
Copy link
Owner Author

liveh2o commented Jul 14, 2015

Tricky. I'll get something up soon.

@liveh2o
Copy link
Owner Author

liveh2o commented Feb 21, 2017

Closing this because the work on v3.0 (#36) covers it.

@liveh2o liveh2o closed this as completed Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants