Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-20-2006, 04:23 AM
Junior Member
 
Posts: 9
Default Strengthening SessionCache.getNextSessionId

The current code looks like:

<pre>
private synchronized static String getNextSessionId() {
return Long.toString(sContextSeqNo++);
}
</pre>

I suggest replacing it with something that takes the account Id as a parameter, then does the following pseudocode:

1. Generate a large random number.
2. Stringify it and prepend the account ID.
3. If it's in the cache already, go back to step 1.
4. Return.

This will give the wonderful advantage of being able to pass sessionIDs back to the client without fearing that they'll be guessed by an attacker, especially when a servlet that doesn't use cookies is running.
Reply With Quote
  #2 (permalink)  
Old 10-20-2006, 08:52 AM
Zimbra Employee
 
Posts: 228
Default

Session Ids are useless without an authtoken, which is already cryptographically secure, and random. They are also tied to an authtoken, which means you can't take your authtoken and try to guess someone else's session id.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.