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

Unscoped find not alerted for find_by! #1786

Open
rbclark opened this issue Jul 14, 2023 · 0 comments
Open

Unscoped find not alerted for find_by! #1786

rbclark opened this issue Jul 14, 2023 · 0 comments

Comments

@rbclark
Copy link

rbclark commented Jul 14, 2023

Background

Brakeman version: 6.0.0
Rails version: 7.0.5.1
Ruby version: 3.2.2

Link to Rails application code:

Model.find_by!(public_find: params[:id]
Model.find_by!(id: params[:id])

Issue

  • Brakeman has been updated to include find_by but it does not include find_by!.
  • Brakeman only checks for find_by on id and doesn't look for any other attributes. In our project the attribute we use public_id instead of id as the publicly facing ID of our models. This means we don't get any warnings for unscoped find for most of our models.
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

1 participant