3 ms·
Since my comment is awaiting moderation there, and there are no other comments so I suspect he's withholding all of them, I'll also post my comment here. This
by lucb1e 14y ago
Since my comment is awaiting moderation there, and there are no other comments so I suspect he's withholding all of them, I'll also post my comment here.
This seems to me as a session collision. You looked at the cookie, so you know something about how these things work, but just to be sure I'm going to explain it in basic terms. Keep in mind that this is just my theory, I'm not not affiliated with Google and have never experienced this myself.
When you log in, on pretty much any website, it generates a session. This session must be unpredictable so that others can't guess what your session is, so there is some random generator involved. An example session could be 7583 (in practice it will be a much larger number, usually with letters or even special characters involved).
When someone else logs in, they will also have a session generated for them. If the random generator happens to pick the same number, it might overwrite your session. If you then open the tab (and your browser remembers the session to keep you logged in), you will appear to be logged in as someone else.
This should never happen. The server should check whether the generated number is already in use. However, the odds of this are incredibly low. With 64-bit sessions, the odds of having two people have the same session is 1 in approximately 18446744073709551616. Even with a billion users logging in, substract 9 decimal positions from that and it's still one in eighteen billion. But it might just happen.
With the millions of users that Gmail has, it might take a lot of resources to check if the session exists somewhere in the world. Or perhaps your session had expired and has been removed, and then someone else logged in and got the session that you were previously assigned. Your browser, not knowing that its session cookie had expired, simply used it.
The odds of this are just so incredibly low, it's very surprising that it happened - if this is what happened. It would perfectly fit your explanation though. Looking at Gmail's cookie, I can't really figure out how many bits of randomness they use. The length is 194 bytes when base64-decoding it, so that would be 1.58*(10^467) possibilities. But I think they simply store some more data there, not just your session.
Hmm, writing this down and looking at the numbers, it's actually more likely that something else messed up, especially considering the complexity of Google's network. Anyhow, a very interesting bug.
- wfunction 14y ago"The odds of this are just so incredibly low... It would perfectly fit your explanation though." Sounds like someone used Maximum Likelihood instead of Maximum A Posteriori.
- lucb1e 14y agoCould you dumb it down? :) What means "maximum a posteriori" and how does it differ from maximum likelihood?
- deleted 14y ago[deleted]
- wfunction 14y agoIt means you tried to find the cause that makes the effect most likely, rather than the most likely cause given the effect. The two are only equivalent if what you know a priori is that all causes are equally likely. In this case they aren't, so a MAP estimate would still give a very low probability to an actual collision, whereas ML doesn't care about the probability of a collision itself -- merely the probability of what it causes. :)
- bobbydavid 14y agoOn the other hand, you have Bayesian probability: even if it looks 99% like Aliens have landed in front yard, you would still be validly assuming it's your neighbors with flashlights. http://en.wikipedia.org/wiki/Bayesian_probability http://en.wikipedia.org/wiki/Bayesian_probability Put simply, you multiply the "a posteriori probability" (i.e. how much it "looks" like it happened) by the original probability (how likely it is to happen).
- thrownaway2424 14y agoThere are lots of possible causes for this. Collision/leak in Chrome Sync, for example. Nobody knows yet.
- jemfinch 14y ago"With 64-bit sessions, the odds of having two people have the same session is 1 in approximately 18446744073709551616." Please read about the Birthday Paradox: http://en.wikipedia.org/wiki/Birthday_Paradox http://en.wikipedia.org/wiki/Birthday_Paradox . The probably of a random collision in 64 bits is 1 in 2^32, not 1 in 264.
- lucb1e 14y agoRight, my bad!
- Joeri 14y agoThe cookie probably contains routing info so your request goes to the data center where that session exists.
- moe 14y agoSites normally employ various mechanisms to prevent session fixation attacks[1] and similar malice. These mechanisms prevent session collisions as a side-effect, thus your scenario seems rather unlikely. [1] http://en.wikipedia.org/wiki/Session_fixation http://en.wikipedia.org/wiki/Session_fixation