Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Session Handling
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matthias Bauer  
View profile  
 More options Nov 21 2007, 8:28 am
From: Matthias Bauer <moef...@moeffju.net>
Date: Wed, 21 Nov 2007 14:28:48 +0100
Local: Wed, Nov 21 2007 8:28 am
Subject: Session Handling
Hey list,

in light of the current discussion about WordPress' insecure cookies
(<http://lwn.net/Articles/259204/>,
<http://trac.wordpress.org/ticket/2394>,
<http://trac.wordpress.org/ticket/5367>), I think it's time we switch to
user sessions instead of always-valid cookies.

Currently, upon login, a user gets a cookie that contains the user ID
and a salted, hashed password. That's a little more secure than what
WordPress does because of the salting and because we use a more
expensive hashing algorithm, but it has the same flaw the WordPress code
has in that the cookie hash is a hash of the password hash, so it's
simple to go from the hashed password to a valid cookie.

The solution is to set cookies for sessions. These can contain
additional information such as expiration time (good), session IP
address (often problematic), etc.

A simple implementation is outlined at
<http://trac.wordpress.org/ticket/5367#comment:3>

We should also consider doubly-hashing the passwords in our DB and
having the session cookie contain the once-hashed version. This way,
both are secure, but there's no feasible way to go from the DB version
to generating a valid cookie. This way, when the database is
compromised, the attacker doesn't know your password nor can she create
a valid login cookie.

Please help me brainstorm on this :D

-Matt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Merrill  
View profile  
 More options Nov 21 2007, 9:02 am
From: Scott Merrill <ski...@skippy.net>
Date: Wed, 21 Nov 2007 09:02:24 -0500
Local: Wed, Nov 21 2007 9:02 am
Subject: Re: [habari-dev] Session Handling

Matthias Bauer wrote:
> in light of the current discussion about WordPress' insecure cookies
> (<http://lwn.net/Articles/259204/>,
> <http://trac.wordpress.org/ticket/2394>,
> <http://trac.wordpress.org/ticket/5367>), I think it's time we switch to
> user sessions instead of always-valid cookies.
...
> Please help me brainstorm on this :D

Switching the location of the double-hashed passwords seems like a
decent first step.

At a recent SANS training class (Security 519) [1], it was strongly
recommended that developers use the database to store persistence for
user sessions between page loads.  The client stores only some session
token (possibly in a cookie), and that token is an identifier for a row
in the DB that contains, at least, the following additional data:
        * first three octets of IP address
        * user agent string
        * timestamp of when the session started

The first three octets of the IP help ensure that the user is coming
from the same network, while still permitting proxy servers.  The user
agent string should never change between sessions: if it does,
immediately log out the user, delete the session row, and prompt for
authentication.

The recommended best practice is to delete the session row from the DB
when it is expired (or when the user elects to log out), so that the
session cannot be reused.

I don't think this would be too hard to code.  Anyone have any concerns
or objections?

1: http://www.sans.org/training/description.php?tid=468

--
GPG 9CFA4B35 | ski...@skippy.net | http://skippy.net/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian Mohn  
View profile  
 More options Nov 21 2007, 6:13 pm
From: "Christian Mohn" <h0b...@gmail.com>
Date: Thu, 22 Nov 2007 00:13:50 +0100
Local: Wed, Nov 21 2007 6:13 pm
Subject: RE: [habari-dev] Re: Session Handling
I asked the Gallery 2 devs about how Gallery 2 handles this, and this is
what I got:

* it binds sessions to a client signature
* we accept a client if it has the same IP as the client that started the
session
* or if the client has the same user-agent signature (the user-agent header)
* based on my beer infected assessment sending md5(md5(password) as cookie
to the client is a pretty stupid idea
(just exposing anything to the client that is related to the password seems
to be a bad idea)
* In Gallery 2 passwords are md5+salt, and the cookie is 100% independent
*for professional apps, you should go as far as using different ids
internally and externally

Remember, I'm just the messenger here and I'm NO authority on this.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »