Set up two seperate pcs. Both have exactly same browser version (same user agent). Log in on first computer with user 1. Log in on second pc with user 2. Check "Remember me" on both.
You are logged in on both pcs every time you visit the page. PC 1 is logged in as User 1 and PC 2 is logged in as User 2.
Because of same user agents, the function getShortHashedUserAgent returns same hash values. Remember me does not work any more, both users are logged out after session expires.
Joomla! 3.4.0 Stable [ Ember ] 24-February-2015 23:00 GMT
Affected files:
/libraries/joomla/user/helper.php function getShortHashedUserAgent()
/plugins/authentication/cookie/cookie.php onUserAuthenticate()
It took me a lot of time, to find this error. Currently, I have no solution for this problem. I currently think about rewriting /plugins/authentication/cookie/cookie.php to not get the cookies deleted.
Has anyone faced the same issue?
You are correct, I made a horrible mistake when understanding how remember me works. I will debug again and search for the source of this error. The error still exists, I am running a huge joomla installation and estimated once a day you are logged out altough "remember me" has been checked, and there is a valid cookie.
I am closing this at this time. Please create a new issue when you determine the cause of your issue
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-07-07 09:00:29 |
Closed_By | ⇒ | brianteeman |
Can you set up the debug plugin so it logs the warnings for the security group? The cookie plugin should trigger log messages if something goes wrong and this could give us a clue why it fails.
Personally I don't think it's due to same browsers. That one is only used to create the name of the cookie. It's a very simple and basic check, not even really security because anyone could guess the name and fake it.
It is used as the identifier together with the user id and the series string. So it shouldn't matter when there are multiple occurances of the same browser even of the same user. The identifier will still be different due to the unique series part.
I think there is one thing which can break the cookie. It is when the browser does some "prefetching" of the page, but doesn't update the cookie while doing so. The cookie contains a one-time token which gets replaced on each login. If the browser sends the valid cookie, but doesn't update the cookie with the new value, then the next real visit will be detected as an attack and all cookies of that user (on all machines) will be invalidated.
Exactly that is happening.
I debugged all variables within the cookie.php file, and came to the conclusion, that either the cookie value or the token in #_user_keys is not updated. When checking password_verify($key,$token) I get false and all the keys of that user get invalidated (the comment on that line tells, that there is an attack).
On my site, this happens thousands of times daily.
What exactly do you mean by prefetching? Do you know, how to get key/token correctly updated?
With prefetching I mean that a browser (or an addon in the browser) may make a request to the site before you actually visit it. I could imagine that happens for example when a browseraddon shows screenshots of the favorite pages. For this it may do the request and take a snapshot which triggers the remember-me plugin, but the addon probably does not change the cookie value as requested by the page. Just an idea.
When you visit the page regular, this is what happens with the cookie authentication:
After the login was performed successful, the cookie plugin gets active again and will
After the user logs out using the logout button, the plugin again gets active and will
Imho, it should work fine as long as the browser behaves and updates the cookie correctly.
Think about it - your assumptions can not be correct - otherwise everyone in the world who is using the same browser as me is logged in to any site that I am logged in to automatically. Clearly that doesnt happen
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7357.