You should look at the documentation from both OWASP and Rails .
Using permit , you have the option to prevent the setting of attributes that you do not want to pass to your helper URL.
Consider the following link to your site coming from a Twitter message:
http:
If your code looks like this, you have problems:
link_to 'View Something', params.merge(format: 'xlsx')
Now the link goes to:
http:
The attacking website phishingscam.example can set the content type to text/html and display a page similar to your registration form. A user who was on your site a minute ago and clicked to see something on your site believes that he is logged out and needs to log in again. Now our attacker has user credentials and can redirect them back to the appropriate link with a user who is completely unaware of what happened.
This is a simple scenario. Things can get messy pretty quickly. You should read the Rails Security Guide to find out more.
source share