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

False positive SQL Injection on scope #833

Closed
dvandersluis opened this Issue Mar 4, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@dvandersluis

dvandersluis commented Mar 4, 2016

I have a scope that looks like:

scope :grouped, -> { group(Post[:user_id]) }

For some reason it's being flagged as a possible SQL injection; any ideas why?

@presidentbeef

This comment has been minimized.

Show comment
Hide comment
@presidentbeef

presidentbeef Mar 17, 2016

Owner

Hi Daniel,

Yes, because group accepts arbitrary SQL and Post[:user_id] is seen as possible user input from the database. I'm not familiar with this syntax...what does Post.[] return? A column?

Owner

presidentbeef commented Mar 17, 2016

Hi Daniel,

Yes, because group accepts arbitrary SQL and Post[:user_id] is seen as possible user input from the database. I'm not familiar with this syntax...what does Post.[] return? A column?

@dvandersluis

This comment has been minimized.

Show comment
Hide comment
@dvandersluis

dvandersluis Mar 17, 2016

It's from the arel_helpers gem (it's equivalent to Post.arel_table[:user_id]), it does return a column (instance of Arel::Attribute).

dvandersluis commented Mar 17, 2016

It's from the arel_helpers gem (it's equivalent to Post.arel_table[:user_id]), it does return a column (instance of Arel::Attribute).

@presidentbeef

This comment has been minimized.

Show comment
Hide comment
@presidentbeef

presidentbeef Jan 28, 2017

Owner

This is fixed with #985

Owner

presidentbeef commented Jan 28, 2017

This is fixed with #985

Repository owner locked and limited conversation to collaborators May 18, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.