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

Fix insecure params error and Add sort_url function. #672

Conversation

amatotsuji
Copy link
Contributor

I found error that Generating a URL from non sanitized request parameters is insecure!.
It caused by generating url using raw unpermited params.
Rails4 or 5 have strong parameters.
I fixed this problem.

And I add sort_url function.
It is return only url of sort_link.

Please review my code and merge to master.

@eluvish
Copy link

eluvish commented Jul 4, 2016

+1 on this. Upgraded to Rails 5 and now getting:
Attempting to generate a URL from non-sanitized request parameters! An attacker can inject malicious data into the generated URL, such as changing the host. Whitelist and sanitize passed parameters to be secure.

@jonatack
Copy link
Contributor

@eluvish Use Ransack master with Rails 5 until a new release is made. This issue has been fixed on Ransack master since a year now.

@amatotsuji Thank you for your pull request! Could you please base it on Ransack master and change the least amount of code?

@jonatack
Copy link
Contributor

@amatotsuji My apologies for the delay in responding to your contribution.

@amatotsuji
Copy link
Contributor Author

@johnnyshields
👍

@jonatack
Copy link
Contributor

@amatotsuji Thank you. I believe the "Fix insecure params error" is no longer an issue. Is the search_params method needed? If not, perhaps rename this PR "Add sort_url view helper" and concentrate on that. It would be good to have a change log entry and tests for the new view helper as well, but I can add them if you don't have time.

@amatotsuji
Copy link
Contributor Author

@jonatack
I can fix by this weekend. I wish you wait until this weekend.

@jonatack
Copy link
Contributor

Happy to, all good.

@amatotsuji amatotsuji mentioned this pull request Jul 27, 2016
@amatotsuji
Copy link
Contributor Author

@jonatack
I recreated a pull request (pull #706).
Could you check my code?

@amatotsuji amatotsuji closed this Jul 28, 2016
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.

3 participants