pen-test
[Top] [All Lists]

Re: How much entropy in a web app session ID?

To: Adam <spamme.adam@gmail.com>
Subject: Re: How much entropy in a web app session ID?
From: Tim <tim-pentest@sentinelchicken.org>
Date: Thu, 21 Dec 2006 11:09:36 -0500
Cc: pen-test@securityfocus.com
Delivered-to: sp-com-lists@consult.net
Delivered-to: pentest-list2@consult.net
Delivered-to: mailing list pen-test@securityfocus.com
Delivered-to: moderator for pen-test@securityfocus.com
In-reply-to: <e49bedad0612201316s196254adm5894099d5ce05da2@mail.gmail.com>
List-help: <mailto:pen-test-help@securityfocus.com>
List-id: <pen-test.list-id.securityfocus.com>
List-post: <mailto:pen-test@securityfocus.com>
List-subscribe: <mailto:pen-test-subscribe@securityfocus.com>
List-unsubscribe: <mailto:pen-test-unsubscribe@securityfocus.com>
Mailing-list: contact pen-test-help@securityfocus.com; run by ezmlm
References: <e49bedad0612201316s196254adm5894099d5ce05da2@mail.gmail.com>
Resent-date: Thu, 21 Dec 2006 09:27:07 -0700 (MST)
Resent-from: pen-test-return-1078483306@securityfocus.com
Resent-message-id: <20061221162707.9073623704E@outgoing3.securityfocus.com>
Resent-sender: listbounce@securityfocus.com
Sender: listbounce@securityfocus.com
User-agent: Mutt/1.5.13 (2006-08-11)
> In the past, I've used symmetric crypt key lengths as a comparison,
> but am I being too tough on the developer? I'd like to have some
> justification behind a finding that says, "Your session ID size of XX
> bits is not big enough".

By having the same entropy as used in your SSL layer, you should be
safe, since as you note, online brute forcing is much slower.

> So here are the factors that I've come up with (for the purposes of
> this discussion, lets assume we've got a decent PRNG that is
> generating the session IDs):
> 
> - How many concurrent sessions does the web application usually have?
> (this is important if the attacker is happy to hijack *any* session,
> as opposed to a *specific* session)
> - Session expiration timeout and typical length of a user session
> (important if the attacker is looking to hijack a specific session)
> - How many concurrent guesses could the web app sustain before
> crashing? (ie. will 50,000 guesses/sec from my bot army crash the
> server long before I can hijack a session?)
> - Is the web app infrastructure protected by an IPS product (that works)?
> 
> So, does anyone out there have any good algorithms/calculations for
> justifying a particular amount of entropy in a session ID?

Well, if you can find out the things above, then try to find out those
same parameters for an offline attack against a 128 bit key.  Then
adjust your session ID length such that the time to crack is
approximately the same.

Of course, it's just easier to make them use a 16 measly bytes of (good)
entropy in their cookies, but if you do perform the calculation with
reasonable parameters, I'm sure some of us would be interested in your
results. =)

cheers,
tim

<Prev in Thread] Current Thread [Next in Thread>