Do login forms need tokens against CSRF attacks?

前端 未结 4 1333
慢半拍i
慢半拍i 2020-11-27 10:45

From what I\'ve learned so far, the purpose of tokens is to prevent an attacker from forging a form submission.

For example, if a website had a form that input added

4条回答
  •  星月不相逢
    2020-11-27 11:07

    Your understanding is correct -- the whole point of CSRF is that the attacker can forge a legitimate-looking request from beforehand. But this cannot be done with a login form unless the attacker knows the victim's username and password, in which case there are more efficient ways to attack (log in yourself).

    Ultimately the only thing that an attacker can do is inconvenience your users by spamming failed logins, when the security system might lock out the user for a period of time.

提交回复
热议问题