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

Make AC::Params.permit_all_parameters thread safe #18003

Merged

Conversation

sikachu
Copy link
Member

@sikachu sikachu commented Dec 12, 2014

As discussed in #16299(1), this attribute is not thread safe and could potentially create a security issue.

As discussed in rails#16299[1], this attribute is not thread safe and could
potentially create a security issue.

[1]: rails#16299 (comment)
@sikachu
Copy link
Member Author

sikachu commented Dec 12, 2014

This may also needed to be backported to 4-2-stable.

rafaelfranca added a commit that referenced this pull request Dec 12, 2014
…afety

Make AC::Params.permit_all_parameters thread safe
@rafaelfranca rafaelfranca merged commit 4b37925 into rails:master Dec 12, 2014
rafaelfranca added a commit that referenced this pull request Dec 12, 2014
…afety

Make AC::Params.permit_all_parameters thread safe
rafaelfranca added a commit that referenced this pull request Dec 12, 2014
…afety

Make AC::Params.permit_all_parameters thread safe
chancancode added a commit that referenced this pull request Dec 19, 2014
chancancode added a commit that referenced this pull request Dec 19, 2014
chancancode added a commit that referenced this pull request Dec 19, 2014
@chancancode
Copy link
Member

Reverted in 5923ee6 and added a note about thread safety. If we really want to support mutating this at runtime, we can do something along the lines of...

def self.permit_all_parameters
  if Thread.current.key?(:action_controller_permit_all_parameters)
    Thread.current[:action_controller_permit_all_parameters]
  else
    # Inherit from config.action_controller.always_permitted_parameters or elsewhere
  end
end

def self.permit_all_parameters=(value)
  Thread.current[:action_controller_permit_all_parameters] = value
end

Not sure if we need to though.

sivagollapalli pushed a commit to sivagollapalli/rails that referenced this pull request Dec 29, 2014
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

Successfully merging this pull request may close these issues.

None yet

5 participants