Cross Site Request Forgery (CSRF) Attacks

Updated , First Published by Pete Freitag

I found a site that has some good security tips for web developers. It mentions one type of attack that doesn't get much attention - called Cross Site Request Forgery (CSRF).

Basically lets say a user is logged into your site, and then they get an email, or go to a malicious web page (without logging out) that directs the user to a file on your site such as /members/cancel_membership.cfm. Oops, they just ran that page as an authenticated user!

Attackers can use this technique to post comment spam, log out users (probably not so bad), change preferences, or do potentially anything your web application lets authenticated users do!

So to prevent these attacks you can't rely simply on checking the http referer because that can be spoofed. The article suggests that you:

Comments

Pete Freitag

Cross Site Request Forgery attacks are also sometimes called XSRF attacks