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

CheckForgerySetting Skips Controllers #848

Closed
jsyeo opened this issue Mar 31, 2016 · 1 comment
Closed

CheckForgerySetting Skips Controllers #848

jsyeo opened this issue Mar 31, 2016 · 1 comment

Comments

@jsyeo
Copy link
Contributor

jsyeo commented Mar 31, 2016

Currently brakeman only performs protect_from_forgery checks in the ApplicationController. While this is sufficient for most cases, it fails to catch controllers that also inherit from ActionController::Base but use a different name. Like for example BaseController or AdminController. See https://github.com/typus/typus/blob/master/app/controllers/admin/base_controller.rb#L1 and https://github.com/spree/spree/blob/148bcaf1e44081f940248d94d3aa6c5e95bb4fe2/api/app/controllers/spree/api/base_controller.rb#L5.

This commit was recently added to typus to turn on CSRF protection. This shows that brakeman shouldn't just simply restrict itself to ApplicationControllers.

@presidentbeef
Copy link
Owner

Agree, related to #664.

Repository owner locked and limited conversation to collaborators Mar 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants