|
|
Posted by Anze on 01/22/07 12:56
Hi!
First of all, thank you both for answering and my sincere apologies for not
replying.
I have completely forgotten that I have posted a question here... :(
>>>> I thought I might have a solution to this, but when trying to implement
>>>> it I figured out that JS can't access SSL-only cookies. :(
>>> That would be really bad:-)
>>
>> Are you sure? I think you are confusing the HTTPOnly attribute with the
>> secure attribute.
>
> No I guess I ddin't make myself clear, it would be really bad if js
> couldn't access these cookies on the clients computer because then a
> cookie would be useless.
I have checked and if either httpOnly or secure is set then JS cannot access
the cookie. Which basically means you can't implement a challenge-response
mechanism for "remember me" authentication, because the cookie is sent
unencrypted anytime the user comes to the login page.
As some measure of security (by no means adequate, of course) you could
change the cookie value anytime user comes to the page. If someone uses the
old value then this is cause for alarm - either a hacker is trying to use
an outdated cookie or the hacker _has_ used the outdated cookie and now
hold the current one.
But that only notifies of a hacking attempt / breakin (and only in most
cases, not always).
>>>> Any thoughts on how to implement secure "remember me" without SSL would
>>>> be appreciated. Even "it can't be done" would be helpful... :)
>>>>
>>> It can't be done in a completely secure way.
>>
>> Yes it can (without SSL). There are pure javascript implementations of
>> RSA (asymmetric encryption) but I suspect you'd need to keep changing the
>> encrpytion key to prevent replay attacks. Its not worth busting the grey
>> cells when SSL should just work.
>>
>
> Ok I can follow your thoughts, but you probably forgot, that he wanted
> to store a persistent cookie, so when the user comes back the next day
> he doesn't have to login. If you consider that then a cookie can also be
> stolen if someone has access to his computer, for example through a
> local account, or through some trojan etc. One of the classics is,
> lloking at edonkey, kazza etc. for cookies, some users are dumb enough
> to also share their home drive:-)
>
> In this case it doesn't help to encrypt the cookies content, because if
> he has the cookie then there is no need for him to decrypt it:-)
Like they say, programming is a race between programmers, trying to build
better, idiot-proof programs, and the Universe, trying to build better
idiots. So far the Universe is winning. :)
If someone gives away his cookies then this is indeed a problem, but not
mine anymore. ;)
Again, thank you both for your thoughts.
I will just notify the clients of the potential security implications and
let them decide whether they want this feature or not.
Best,
Anze
[Back to original message]
|