Is CSRF a threat if not using cookies? Is CSRF a threat if not using cookies? flask flask

Is CSRF a threat if not using cookies?


CSRF isn't just protection against CORS AJAX. I could make a form on my site, and set the action to http://yoursite.com/account/delete. If a user submits my form, without CSRF on your site, the action would succeed. Or if you have things change on GET requests (shouldn't do that anyway), I could add this to my site:

<img src="http://yoursite.com/account/delete" />

and the action would happen when my page loads.

Check out Flask-WTF or this snippet: http://flask.pocoo.org/snippets/3/

EDIT

From your comment:

Change the action of that page to a POST, and have it be accessed through a form instead of a link. If your link was:

<a href="{{ url_for('my_page') }}">Click Here</>

Your form could be (using Flask-WTF, which you would need):

<form action="{{ url_for('my_page') }}" method="POST">    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />    <input type="submit" value="Click Here" /></form>