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

Use Arel.sql to wrap a known safe SQL string in PermissionsService #3888

Merged
merged 1 commit into from
Jul 16, 2019

Conversation

no-reply
Copy link
Contributor

To protect against injection attacks, #pluck has deprecated raw SQL strings in
Rails 5.2.

We could use pluck(:source_id).uniq here. This would be less efficient in
some cases. I didn't have the time to look into whether those cases are likely
to arise, so we simply mark the SQL string as safe by wrapping it with
Arel.sql().

Connected to #3030

@samvera/hyrax-code-reviewers

To protect against injection attacks, `#pluck` has deprecated raw SQL strings in
Rails 5.2.

We could use `pluck(:source_id).uniq` here. This would be less efficient in
some cases. I didn't have the time to look into whether those cases are likely
to arise, so we simply mark the SQL string as safe by wrapping it with
`Arel.sql()`.
Copy link
Member

@cjcolvar cjcolvar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@no-reply no-reply merged commit cbc79be into master Jul 16, 2019
@no-reply no-reply deleted the arel_wrap branch July 16, 2019 17:58
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.

2 participants