Reason for requiring CSRF on login page?
-
Typically CSRF tokens protects users with authenticated sessions from executing single request surreptitiously to change some state of the application (ie update firewall rules) where the request URI parameters are known by a malicious 3rd party. For the login page the user is not authenticated, the request parameters (the user's credential) are not likely to be known, and the single action (logging in) is unlikely to be of value to the attacker.
Having the CSRF token required on the login page does add a minor annoyance in that if you leave the login page open longer than the token life, when you go to actually login you will have to either refresh the page or click the retry button. Minor but unnecessary.
-
Yes.
For a basic reasoning, see https://en.wikipedia.org/wiki/Cross-site_request_forgery#Forging_login_requests but there are other more detailed examples out there as well.
-
Oh interesting. In my understanding if there was only one user this attack would not be possible and possibly if the user logging in already has the maximum escalated privileges this attack becomes much less useful. I understand that these are likely small enough use cases they would not warrant mitigation for the login page token expiry.
Thanks for the explanation!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginPrivacy Policy · Cookie Policy