Groups | Blog | Home
all groups > iis security > january 2008 >

iis security : IIS6 - Can session id be manipulated?


Kim Hellan
1/29/2008 12:59:41 PM
Hi,

I have gotten a question about how IIS6 handles the session id (cookie).
I've got a very persistent customer who claims, that you can just hijack
another session by changing the session id in your own session cookie.
I'm no security expert, but I find that very hard to believe. All though I
haven't been able to find documentation about how the IIS handles the
session id in a secure way, so it can't be manipulated.

Does anyone have some links to MS descriptions or something like that, so I
can show the customer you can just hijack another persons session?

Thanks,
John

Daniel Crichton
1/29/2008 3:00:16 PM
Kim wrote on Tue, 29 Jan 2008 12:59:41 +0100:

[quoted text, click to view]

I'm pretty sure that your customer is right - otherwise you'd get all sorts
of issues with customers on dynamically changing IP addresses or proxies
hiding other possibly identifiable information to tie the cookie to. Of
course, the hijacker would have to actually guess or determine the session
cookie that they want to hijack, and if they manage to intercept the cookie
then hijacking a session could be the least of your, or your customers,
problems as they'd likely also be able to just dump all the packets and view
what is being passed back and forth anyway.

I don't use the ASP sessions except for the odd occassion where it makes it
easy to handle some non-critical temporary data (like generated captcha
values for subsequent comparison in forms), all the sites I run use a custom
session handling system that combines a variety of factors to determine
possible hijacking of the cookies used.

--
Dan

Daniel Crichton
1/29/2008 3:05:53 PM
Kim wrote on Tue, 29 Jan 2008 12:59:41 +0100:

[quoted text, click to view]


For a bit more info, try this: http://www.microsoft.com/technet/security/Bulletin/MS00-080.mspx

it describes a patch for IIS4 and IIS5 to ensure that the session id cookie
used on secure (SSL) pages wasn't also used when viewing non-secure pages.
This helps to reduce the possibilty of a hijack if you allow customers to
view both secure and non-secure pages on your site. It still doesn't solve
the problem, as it requires that two different session IDs are used for
secure and non-secure pages, so the non-secure one could still be hijacked.

If you're really worried about session hijacking, run everything over SSL -
while it won't completely prevent it, it reduces the risk because in order
to get the session cookie the hijacker would have to intercept the data when
it's unencrypted (either at the customer's browser, or the server) and if
that happens then you've got a lot more to worry about that session cookies.

--
Dan

John Hansen
1/31/2008 1:28:45 PM
Hi,

Thank you for the answer.
I don't think it's so much a case of whether you can grab another persons
session cookie from a non-secure line or not.
It's more like this:
I sit on computer A connected to server X
You sit on computer B connected to server X

If I can guess your session id and put that number in my own session cookie,
can I then get access to your session data?

Regards,
John


[quoted text, click to view]

Daniel Crichton
1/31/2008 4:38:55 PM
John wrote on Thu, 31 Jan 2008 13:28:45 +0100:

[quoted text, click to view]

Yes, that's right. I did say in my other reply that the hijacker would have
to guess it or determine it.

Getting access to a session isn't always a critical issue though - for
instance, on my own sites ASP sessions are only used for holding a captcha
string for a short time, no personal information is held in an ASP session
object and without a page on the sites that spits out what values the
session object contains even being able to hijack a session on my sites is a
waste of time.

--
Dan

John Hansen
2/4/2008 9:41:43 AM

"Daniel Crichton" <msnews@worldofspack.com> skrev i en meddelelse
news:usxZGfCZIHA.4476@TK2MSFTNGP06.phx.gbl...
[quoted text, click to view]

Hi,

Thank you for the answer.
I must say, that I'm a bit surprised/worried it is that "easy" to take over
another persons session... just by guessing their session id.
I had expected that maybe the id was signed by the server or something like
that, so that it couldn't be manipulated.

Regards,
John

Daniel Crichton
2/4/2008 9:57:41 AM
John wrote on Mon, 4 Feb 2008 09:41:43 +0100:


[quoted text, click to view]


[quoted text, click to view]

A cookie is a cookie - it's just a HTTP header. HTTP is the limiting factor
here, there's no standard method for encrypting headers/cookies, they were
only ever designed as a simple, if unsecure, way of trying to make HTTP
"stateful". The simple answer is to not use sessions for holding critical
data, instead look at implementing either Integrated Auth or Basic Auth over
SSL, or a custom authentication system, and hold all the critical data
server-side.

--
Dan

AddThis Social Bookmark Button