pf » Cross Site Request Forgery (CSRF) Attacks
Cross Site Request Forgery (CSRF) Attacks
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:
- Require HTTP POST operations, instead of HTTP GET's (when your passing parameters)
- Include some sort of hash in the form post based on the users credentials, then validate the hash on the server before performing the operation.
- You will also want to do server side confirmations (eg: are you sure you want to delete?)
Related Entries
- Firefox 3.5 Introduces Origin Header, Security Features - June 30, 2009
- Announcing Web Application Firewall for ColdFusion - July 9, 2007
- The Dangers of Flash's crossdomain.xml - November 2, 2006
- 20 ways to Secure your Apache Configuration - December 6, 2005
- MySpace Hacked with CSRF and XSS - October 13, 2005
- J2EE Session Cookies on ColdFusion / JRun
- Hands on ColdFusion Security Training
- ColdFusion 9 Solr Vulnerability - Are you at Risk?
- FCKEditor Year 2010 Bug for Firefox 3.6
- jQuery UI Sortable Tutorial
- CFLogin Security Considerations
- Use varchar(max) instead of text in SQL Server
- ColdFusion SOAP Web Services and onRequestStart
RSS

add to del.icio.us
Pete Freitag is a software engineer, and web developer located in











