Reason for using more cookies than just a session hash for authentication?

I usually hang out in a community using bulletin board software.

I watched this software save as a cookie in my browser.

As you can see, this saves 6 cookies. Among them, what I consider important for authentication is:

  • ngisessionhash: hash of the current session
  • ngipassword: hash (possibly not a simple password) password
  • ngiuserid: user id

These are my assumptions, of course. I do not know for sure whether ngilastactivity and ngilastvisit are used for the same reason.

My question is: why use all these cookies for authentication? My guess would be that maybe creating a session hash would be easy, so using hashedpassword and userid adds security, but what about swapping cookies? I basically leave all the basic information on the client.

What do you think?

UPDATE # 1

The content of these cookies is what I think they contain. I am not sure about that. Of course, if you call the cookie ngivbpassword and contains a hash, I assume hashedpassword. It could probably be password + salt.

My main problem is that this solution gives a lot of information when cookies are under attack.

UPDATE # 2 This question does not want to criticize how this particular software works, but back to these answers, I just want to learn more about software protection in a web environment.

+7
source share
4 answers

This is because session and login cookies may have different life cycles.

Imagine a website with millions of users every day. The website will not store your session for a year just to send you the next time you return. To do this, they use cookies to log in.

These cookies are also called Remember-Me cookies.

+2
source

Sessions are not saved. Cookies

Update # 1: I did not work with vBullettin, but it looks like the classic Remember Me feature.

Update # 2:

Yes, this is a catchy feature, I'm asking why they do it this way

Good ... How do you implement the Remember Me feature? Obviously you need to use cookies, I assume this is clear. Now what do you keep?

The most naive way is to save the user and password in clear text and perform basic authentication. This is one of the most insecure mechanisms you can use, but some sites actually do it that way.

The second slightly less naive way is to save the user hash and password and perform a modified version of basic authentication. Not as bad as the previous method, but it still suffers from some problems; for example, there is no effective way to disable or expire a stored cookie from a server.

The third way is to save the database table with “remembered” sessions, identify each of them with a long unique string and save such a string in a cookie. A string can be random or calculated, but, of course, randomness has the advantage that the string cannot be guessed even if you know the algorithm.

Further security can be achieved by storing dates, IP addresses and other pieces of data on the server.

As I said, I don't know anything about vBulleting, but it seems like they are using method 2 or method 3.

Update # 3:

The content of these cookies is what I think they contain. I'm not sure about that. Of course, if you call the cookie ngivbpassword and contains a hash, my Guess is hashedpassword. It could probably be password + salt. [...] My main concern is this decision to a lot of information when under the attack of swapping cookies.

Successful cookie merging allows you to completely personalize the user so you can simply log in to the control panel and enjoy a free buffet, which rendered the cookie content irrelevant.

Will they keep a salty password or is it just a name that I don’t know.

+1
source

The question is, what are your problems? Are you building some kind of authentication system? I also think that having a user ID and password in cookies can be a security issue. is a user id or integer?

0
source
  • Cookies should be as small as they are - this is a world of information about who you are on the server.

  • Sessionhash, session_id or sid - unique identifier (session on the server). Other cookies can be easily hidden on the server side.

  • Saving a password hash in cookies is a security issue. You should avoid this.

  • The last 4 cookies come from Google ads.

PS. In any case, most message boards are not so great software.

0
source

All Articles