Joomla! Discussion Forums



It is currently Wed Nov 25, 2009 4:48 am (All times are UTC )

 




Post new topic Reply to topic  [ 86 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
Posted: Wed Feb 01, 2006 7:51 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Sat Oct 29, 2005 3:27 pm
Posts: 249
stingrey wrote:
Just posting to indicate that we have monitored this discussion and are considering Grams proposed solution.

Although I cant say at this stage the exact manner in which we will solve this issue, whether by:
- Grams proposal,
- a combination of Grams proposal and something else, or
- something else entirely - if we can find better solution

What I will say is that it be integrated into 1.0.8 and 1.1.x


Thanks must to Gram for a very detailed and through explanation of the issues surrounding the problem.
And thanks for the proposed solution, it is food for thought.

Awesome you're looking to this!

Any change we'll also see back some of the other suggestions posted here? :)


Top
   
 
Posted: Wed Feb 01, 2006 9:35 am 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Thu Jan 26, 2006 11:36 pm
Posts: 71
Location: Los Angeles, California, United States
I've been testing the AOL variant of this hack now for two days and I've had no problems.

I've experienced nothing but the added benefit of slight pageload speed improvement.  Oh and my mos_session table entries are consistently about 1/3rd of what they used to be, thus my "who's online" module is reflecting a more accurate number of guests.

I'm sticking with this hack unless something goes wrong (in which case, I'll report back my results in this forum).

-Tyler

_________________
-Tyler D.
Web Developer & Integrator: http://www.LasVegasExtremes.com


Top
  E-mail  
 
Posted: Wed Feb 01, 2006 1:59 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Aug 17, 2005 11:22 pm
Posts: 395
Location: Southern California
Thanks Tyler!

GRAM

_________________
GRAM
http://coders.mlshomequest.com/ < -- Developer of samSiteMap component


Top
  E-mail  
 
Posted: Wed Feb 01, 2006 5:00 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Aug 17, 2005 11:22 pm
Posts: 395
Location: Southern California
Diff file for unified solution (AOL/Proxy fix is option that can be enabled) is attached. 

I created the last one incorrectly.

GRAM


You do not have the required permissions to view the files attached to this post.

_________________
GRAM
http://coders.mlshomequest.com/ < -- Developer of samSiteMap component


Top
  E-mail  
 
Posted: Wed Feb 01, 2006 5:06 pm 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Mon Aug 15, 2005 4:36 pm
Posts: 2399
Location: Marikina, Metro Manila, Philippines
gram wrote:
Diff file for unified solution (AOL/Proxy fix is option that can be enabled) is attached. 

Thanks, this I can follow easier.

_________________
God grant me the Serenity to Accept the things I cannot change, the Courage to change the things I can and the Wisdom to know the Difference.


Top
  E-mail  
 
Posted: Wed Feb 01, 2006 5:09 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Aug 17, 2005 11:22 pm
Posts: 395
Location: Southern California
Hackwar wrote:
@gram
To remove the only drawback you could find, wouldn't it be possible to implement a switch that, when set, pushes the login-functions to use the old way of authentication?


New unified verion of this hack (attached to first post of this thread) now looks for a POST variable called 'force_session'.  If it finds it, it will proceed with session setup.  New version does not check the value of this variable, only tests (isset()) to see if it is there.

External login forms that include this variable will now properly log users in, and they won't get the 'cookies required' message.

Thanks for the suggestion Hackwar!

GRAM

_________________
GRAM
http://coders.mlshomequest.com/ < -- Developer of samSiteMap component


Last edited by gram on Wed Feb 01, 2006 5:12 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Wed Feb 01, 2006 9:19 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Mon Aug 22, 2005 9:44 pm
Posts: 158
I'll be testing this hack out as well--THANKS! Until now, just had to tell people it was their fault for using AOL.  :)

_________________
...www.larynandjanel.com...


Top
  E-mail  
 
Posted: Wed Feb 01, 2006 10:16 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Aug 17, 2005 11:22 pm
Posts: 395
Location: Southern California
@lpkb,

Please keep us posted with how it goes.

Thanks,

GRAM

_________________
GRAM
http://coders.mlshomequest.com/ < -- Developer of samSiteMap component


Top
  E-mail  
 
Posted: Wed Feb 01, 2006 10:25 pm 
Joomla! Intern
Joomla! Intern
Offline

Joined: Tue Aug 23, 2005 6:04 pm
Posts: 78
I've implemented "original Gram AOL hack" :) sounds nice  ;) and my guests number dropped about 2/3 (visitor count is much more accurate right now I think).

Matjong wrote:
(1) User visit website
(2) Joomla identifies user based by comparing the cookie & IP with the hash in database
(3) If user is identified Joomla creates a new session hash based on IP / random number
(4) Joomla updates the cookie, and updates the old session with the new session in the database


I would adjust Step (3) in a way that new session_id hash would be based on IP+rand+time+previous_session_id somehow, and implement mechanism/function to allow recreation of past few session_ids, that way if users arrives with old(er) session_id because of TCP problems, Joomla can still authenticate. Is that even possible and feasible?

Or may be simply remember past 5 session_ids and their expiration time in database?

_________________
Peter Saitz
www.blastchat.com


Top
  E-mail  
 
Posted: Wed Feb 01, 2006 11:05 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Aug 17, 2005 11:22 pm
Posts: 395
Location: Southern California
Prutkar wrote:
I've implemented "original Gram AOL hack" :) sounds nice  ;) and my guests number dropped about 2/3 (visitor count is much more accurate right now I think).


Thanks Peter! 

I appreciate you reporting your results.

Quote:
I would adjust Step (3) in a way that new session_id hash would be based on IP+rand+time+previous_session_id somehow, and implement mechanism/function to allow recreation of past few session_ids, that way if users arrives with old(er) session_id because of TCP problems, Joomla can still authenticate. Is that even possible and feasible?

Or may be simply remember past 5 session_ids and their expiration time in database?


It kind of defeats the rolling mechanism, by allowing a previous session to authenticate.  But would be do-able.  The less previous sessions allowed, the stronger it becomes....

It also requires a QUERY - Compare, where we now just have a query, so if used, would need to be subsequent to a failed initial query (looking for current session id).

However, this could be done by adding one field to the database, and converting the query to a query compare.  If a sessionid remained constant, and we added an auth_id field, we could serialize an array of acceptable auth_id's, in order of use, to be compared against.  On success, we pop the array to roll one off, add the new one and proceed with update.

This could actually provide a mechanism for deploying a rolling session value without verifying that the client had recieved an updated auth_id from the last page request (for TCP failure).  By keeping the last assigned auth_id and the auth_id it replaced, we could confirm the client was in posession of one of the last two assigned auth_id's , roll the values and save.  Client could authenticate with either of the last two assigned auth_ids, which would constantly roll with the page requests.

We are already doing an update, so only added overhead is the compare, and pop and replace.

GRAM

_________________
GRAM
http://coders.mlshomequest.com/ < -- Developer of samSiteMap component


Last edited by gram on Wed Feb 01, 2006 11:44 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Sun Feb 05, 2006 12:08 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Sep 10, 2005 10:31 pm
Posts: 823
Wow, long reading so far. I just realized this thread... Gram, haven't looked at your patch yet, will do so later. Thanks for taking over this problem anyway.

gram wrote:
On the internet we have grown accustomed to dealing with dropped packets and momentary interuptions of throughput.  But it wreaks havic for rolling session ids (thats what we called this technique).  Here's one scenario (there are numerous others):
[...]
Now the server is using a new session id for that user, but the user never recieved it.  So when the user tries to refresh the page, they no longer have a valid session id and end up logged out (at this point, there should be a recognition of this invalid session at the application/Joomla level and the user gets a 'sorry' page and a request to re enter thier password or both password and username).


Thanks also for this good explanation on the problem of rolling session IDs. I like Prutkar's suggestion of allowing a few (as few as possible, so maybe only one) old session id's in addition to the most current one.

gram wrote:
Quote:
[...]
Or may be simply remember past 5 session_ids and their expiration time in database?


It kind of defeats the rolling mechanism, by allowing a previous session to authenticate.  But would be do-able.  The less previous sessions allowed, the stronger it becomes....


In addition to this, here's my proposal on how to get some feedback that an user has received the new session id. As almost every template is using  a CSS-file or at least an image, wouldn't it be possible to have an php-file that
  • returns the css-file or image with apropriate headers (Mime-type...),
  • sends out headers that this file may never be cached,
  • and finally takes a look at the session id it gets send back by the user. If this is the new session id, the old one could be deleted out of the array of previos session ids.

I know, the drawback of this method would be some even higher page traffic. On the other hand, you could also use the php-script to send back the favicon which is fairly small. As the favicon is included in the html-headers (and this one gets created in the core, mosShowHead()), this should be fairly easy to implement without having to change all templates.

I hope I could make myself clear. Please let me know what you think about this idea.

_________________
We may not be able to control the wind, but we can always adjust our sails


Top
   
 
Posted: Sun Feb 05, 2006 12:27 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Sep 10, 2005 10:31 pm
Posts: 823
Matjong wrote:
- Sequences in IP, less sequences means less problems. 3 sequences don't fix all problems, because some ISP's (even AOL) allow jumping between different class A networks, so from 100.100.100.100 to 200.100.100.100 etc.


Another two cents on this:
What about having another variable than $mosConfig_fix_proxy? On that could take a "subnet" mask that gets applied with "logical and" to the visitors IP? Thus, every admin could decide for him-/herself how important security is for them. One would use a subnet of "255.255.255.0" for the AOL hack, "255.255.255.255" for no IP jumping at all, or "0.0.0.0" for those who don't need security at all or want to allow AOL users with jumping class A proxies.

_________________
We may not be able to control the wind, but we can always adjust our sails


Top
   
 
Posted: Sun Feb 05, 2006 8:54 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Aug 17, 2005 11:22 pm
Posts: 395
Location: Southern California
friesengeist wrote:
In addition to this, here's my proposal on how to get some feedback that an user has received the new session id. As almost every template is using  a CSS-file or at least an image, wouldn't it be possible to have an php-file that
  • returns the css-file or image with apropriate headers (Mime-type...),
  • sends out headers that this file may never be cached,
  • and finally takes a look at the session id it gets send back by the user. If this is the new session id, the old one could be deleted out of the array of previos session ids.

I know, the drawback of this method would be some even higher page traffic. On the other hand, you could also use the php-script to send back the favicon which is fairly small. As the favicon is included in the html-headers (and this one gets created in the core, mosShowHead()), this should be fairly easy to implement without having to change all templates.

I hope I could make myself clear. Please let me know what you think about this idea.


I really like this idea.  We could send a request to a session validator (as you outlined), session validator would always return the favicon (in spite of how it may have been called).

I don't know the answer to this, but do all browsers respect and load the favicon?  For example, would a reader respect it?  Thinking only of accessibility, not the search engines.

GRAM

_________________
GRAM
http://coders.mlshomequest.com/ < -- Developer of samSiteMap component


Top
  E-mail  
 
Posted: Sun Feb 05, 2006 9:01 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Sep 10, 2005 10:31 pm
Posts: 823
gram wrote:
I don't know the answer to this, but do all browsers respect and load the favicon?  For example, would a reader respect it?  Thinking only of accessibility, not the search engines.


Oops, good point. Just tested with lynx, on my site it does not load the favicon (not showing up in logfiles). (Why should it, lynx can't display it anyway ;-)

_________________
We may not be able to control the wind, but we can always adjust our sails


Top
   
 
Posted: Sun Feb 05, 2006 10:37 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Sat Oct 29, 2005 3:27 pm
Posts: 249
friesengeist wrote:
Matjong wrote:
- Sequences in IP, less sequences means less problems. 3 sequences don't fix all problems, because some ISP's (even AOL) allow jumping between different class A networks, so from 100.100.100.100 to 200.100.100.100 etc.


Another two cents on this:
What about having another variable than $mosConfig_fix_proxy? On that could take a "subnet" mask that gets applied with "logical and" to the visitors IP? Thus, every admin could decide for him-/herself how important security is for them. One would use a subnet of "255.255.255.0" for the AOL hack, "255.255.255.255" for no IP jumping at all, or "0.0.0.0" for those who don't need security at all or want to allow AOL users with jumping class A proxies.

That's exactly what I said a couple of posts earlier... I think it would be a good thing :)

Btw, I'm still folowing the discussion closely, but not posting atm. I'm overthinking things at the moment and working on a security document for Joomla where I want to point this out (as possible suggestions for the core team). :)


Top
   
 
Posted: Sun Feb 05, 2006 11:03 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Sep 10, 2005 10:31 pm
Posts: 823
Matjong wrote:
That's exactly what I said a couple of posts earlier... I think it would be a good thing :)

Hm, looks like I didn't read the thread carefully enough, although I thought I did so...  :-[

_________________
We may not be able to control the wind, but we can always adjust our sails


Top
   
 
Posted: Sun Feb 05, 2006 11:25 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Aug 17, 2005 11:22 pm
Posts: 395
Location: Southern California
Stay in here friesengeist  :)

The rest of has have the the luxery of reading this thread as each post was put up.

You had a good suggestion.

GRAM

_________________
GRAM
http://coders.mlshomequest.com/ < -- Developer of samSiteMap component


Top
  E-mail  
 
Posted: Mon Feb 06, 2006 10:09 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Sat Oct 29, 2005 3:27 pm
Posts: 249
friesengeist wrote:
Matjong wrote:
That's exactly what I said a couple of posts earlier... I think it would be a good thing :)

Hm, looks like I didn't read the thread carefully enough, although I thought I did so...  :-[

Ah well, it is a good suggestion you made there and this confirms more people are thinking this way! :)


Top
   
 
Posted: Tue Feb 07, 2006 12:12 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Jan 19, 2006 4:12 am
Posts: 37
Great effort!
I actually read the whole thing! Now I'm off to implement it on my site. I had wondered why my counts had been inflated so much. What actually worries me is that I think I understood this thread. Without your efforts I would have had no clue how to do it. I had wondered about the clear text password issue myself. A number of more secure sites use https for login authentication and then drop to http for the rest of the session. I guess that is beyond joomla since it would require secure server for every site.

W

_________________
W


Top
   
 
Posted: Fri Feb 10, 2006 12:56 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Feb 03, 2006 10:06 pm
Posts: 7
Any word on when 1.0.8 will be out with these changes? or would it be best to wait for 1.1?


Last edited by philenium on Fri Feb 10, 2006 7:46 am, edited 1 time in total.

Top
  E-mail  
 
Posted: Fri Feb 10, 2006 7:46 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Sat Oct 29, 2005 3:27 pm
Posts: 249
philenium wrote:
Any word on when 1.8 will be out with these changes?

I don't think 1.0.8 will have these changes, maybe 1.0.9 or 1.1.


Top
   
 
Posted: Fri Feb 10, 2006 8:34 am 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Mon Aug 15, 2005 4:36 pm
Posts: 2399
Location: Marikina, Metro Manila, Philippines
Actually I am looking into this issue - as it affects security - to see if I can include it into 1.0.8

Still working on it, so still not sure if this will make it into 1.0.8

_________________
God grant me the Serenity to Accept the things I cannot change, the Courage to change the things I can and the Wisdom to know the Difference.


Top
  E-mail  
 
Posted: Fri Feb 10, 2006 8:35 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Sat Oct 29, 2005 3:27 pm
Posts: 249
stingrey wrote:
Actually I am looking into this issue - as it affects security - to see if I can include it into 1.0.8

Still working on it, so still not sure if this will make it into 1.0.8

Ok :)


Top
   
 
Posted: Sat Feb 11, 2006 9:38 am 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Mon Aug 15, 2005 4:36 pm
Posts: 2399
Location: Marikina, Metro Manila, Philippines
In direct consultation with Steve, his major components of his two part proposal is being utilized directly into 1.0.8.
  • 1. Introduction of cookie testing before the creation of a session record, hopefully reducing strain on session table, reducing incorrect session records and giving a more accurate session count
  • 2. Three level option for Session ID generated to handle IP subnets and backward compat.  Also a hardening of Session ID by inclusion of HTTP_USER_AGENT and $mosConfig_secret value (randomized value unique to a site).  Which should improve Session ID security even with Subnet option compared to current session ID handling
    This has resulted in a new Global Configuration param  "Session Authentication Method"

*Note this change may impact bridging software*

Now although the idea is Steve's the actual code utilized in core is slitghly different - but the affect is the same



Now although there was some discussion about keeping older sessions this idea is not being introduced.  Mainly because this would lead to a dilution of the security level.  Further it would lead to even more sessions in the session db table - which is what we are trying to reduce.  Further it would require more changes in other areas of code.  Basically this is a funcitonality request and as such beyond the scope of Stabiity work.



More detailed information about this change will be published on the Official Developer Blogs during the weekend:
http://dev.joomla.org/component/option, ... Itemid,51/



I'd like to publicly acknowledge Steve for his outstanding work on this matter.
He provided a succinct response and timely solution to an obvious problem.  He meticilously researched the issues at hand and put together a detailed specification of the problem, issues and more importantly provided a solution.  I also thank all the people who provided feedback on his work - helping assist in putting together the solution.

It is only through such strong community participation & involvement in this parthenership that Joomla! will be successful.


Kudos and thanks to Steve!!

_________________
God grant me the Serenity to Accept the things I cannot change, the Courage to change the things I can and the Wisdom to know the Difference.


Last edited by stingrey on Sat Feb 11, 2006 9:40 am, edited 1 time in total.

Top
  E-mail  
 
Posted: Sat Feb 11, 2006 9:43 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Sat Oct 29, 2005 3:27 pm
Posts: 249
Good to hear, nice improvement :)

I also want a "thank you" for my input in this matter :o :laugh: *Is jalous*


Top
   
 
Posted: Sat Feb 11, 2006 4:15 pm 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Mon Aug 15, 2005 4:36 pm
Posts: 2399
Location: Marikina, Metro Manila, Philippines
Well I can report very positvely that the addition of the Cookie test before the creation of session ids - to try limit overinflated creation of sessions - seems to working properly.

I have uploaded the modifications to http://www.joomla.org
Previously the who's online counter was persistently showing session counts of 8000+, now it reports a more reasonable 200+
You can see that I have now published the who's online module.


The drawback is of course that it wont show people only opening/visiting your site once (as sessions are only created on the 2nd page request of a user) but I think this is countered by the lessening of the strain on the session db table - thereby reducing possibility of this tablke being corrupted - and leads to far more reasonable user count numbers: albeit probably undervalued slightly.

_________________
God grant me the Serenity to Accept the things I cannot change, the Courage to change the things I can and the Wisdom to know the Difference.


Last edited by stingrey on Sat Feb 11, 2006 5:51 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Sat Feb 11, 2006 5:18 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Aug 17, 2005 11:22 pm
Posts: 395
Location: Southern California
It sure is good to get that report Rey.  It confirms the devs commitment to resolving this issue and the validity of the solution (as concept).

Quote:
Kudos and thanks to Steve!!


Thank you for the kind words.  It was a small thing given the scope of work undertaken by the devs to constantly improve upon and maintain the codebase.  I am happy to have been able to contribute  ;D

GRAM

_________________
GRAM
http://coders.mlshomequest.com/ < -- Developer of samSiteMap component


Top
  E-mail  
 
Posted: Sat Feb 11, 2006 10:51 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Dec 26, 2005 10:33 am
Posts: 18
Hi can someone please post a link to the patched joomla.php file i have tried to patch the file but i am not a php programmer i have it installed but AOL users are still complaining that they are unable to log in.

Thank you
Swampy


Top
  E-mail  
 
Posted: Sat Feb 11, 2006 11:41 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Aug 17, 2005 11:22 pm
Posts: 395
Location: Southern California
The file attached to the first post in this thread is the latest one Swampy.

The files from 1.08 won't work with any other version, but do essentially the same thing.

Is this the file you are using?

GRAM

_________________
GRAM
http://coders.mlshomequest.com/ < -- Developer of samSiteMap component


Top
  E-mail  
 
Posted: Sun Feb 12, 2006 7:49 am 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Mon Aug 15, 2005 4:36 pm
Posts: 2399
Location: Marikina, Metro Manila, Philippines
gram wrote:
The files from 1.08 won't work with any other version, but do essentially the same thing.

If you pull the joomla.php from the 1.0.x SVN this is not enough to institute the changes.

By default the highest security setting is utilized - which is to use Full IP.
o be able to use IP Subnetting (which is what you want for AOL users) you also need the changes to the com_config folder.  This allows you to change the setting from the default.


You do not have the required permissions to view the files attached to this post.

_________________
God grant me the Serenity to Accept the things I cannot change, the Courage to change the things I can and the Wisdom to know the Difference.


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 86 posts ]  Go to page Previous  1, 2, 3  Next

Quick reply

 



Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group