Form Authentication - Cookie replay attack - protection

后端 未结 4 1814
滥情空心
滥情空心 2020-12-01 22:15

I am being asked about cookie replay attacks with my ASP.NET websites forms authentication.

I have followed the advice below to protect against any attack but think

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 22:36

    A simple idea is to generate a random guid and store it in the user data section of the cookie. Then, when a user logs out, you retrieve the guid from the user data and write it in a server side repository with an annotation that this "session" has ended.

    Then, have an http module that checks upon every request whether or not the guid from the userdata section of your cookie doesn't point to a ended session. If yes, terminate the request with a warning that expired cookie is reused.

    This comes with a cost of an additional lookup per request.

提交回复
热议问题