R – Why can CSRF attack be prevented by a random CSRF secret

csrfSecurity

to prevent CSRF attacks, a random CSRF
secret has been generated.

The above is from symfony:
http://www.symfony-project.org/getting-started/1_4/en/04-Project-Setup

Since it's finally operated by users,which is so called deputy attack.how can it work by setting that secret?

Best Answer

OWASP (open web application security project) has very good explanation on CSRF, I encourage you to read it and post your questions afterwards.

http://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)

If you are looking for sample implementation on how to prevent CSRF, take a look at Django and its write-up. http://docs.djangoproject.com/en/dev/ref/contrib/csrf/

Related Topic