After reading this: http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-to-use-it
I came to the conclusion that you canโt use this, unless you trust the person who uses the page that credits him. Is it correct?
I think I really don't understand when it is safe to use because of this statement:
This should not be done for POST forms for destination external URLs, as it will cause the CSRF token to leak, which leads to a vulnerability.
The reason this is confusing is this: to me the โexternal URLโ will be a page that is not part of my domain (that is, I have www.example.com and put in the form that posts to www.spamfoo.com This obviously cannot be because people will not use Django to create forms that submit to other people's sites, but how can it be true that you cannot use CSRF protection on public forms (for example, in the login form )?
source share