httpOnly Cookies in Firefox 2.0Tuesday, October 24. 2006Tuesday, October 24. 2006 httpOnly cookies are a Microsoft extension to the cookie standard. The idea is that cookies marked as httpOnly cannot be accessed from JavaScript. This was implemented to stop cookie stealing through XSS vulnerabilities. This is unlike many people believe not a way to stop XSS vulnerabilities, but a way to stop one of the possible attacks (cookie stealing) that are possible through XSS.
Comments
Display comments as
(Linear | Threaded)
#1
Chris
()
What about this scenario- a non-httpOnly cookie whose name happens to start with hO_ is sent to the browser.
Okay, it is not encrypted inbound because it is not httpOnly. But what then happens outbound? Will the outbound hook try to decrypt it just because it's name begins with hO_? What will that do to the cookie data? posted on Wednesday, October 25. 2006
Chris,
the extension is only a proof of concept at the moment. Therefore unlikely scenarios like the above are not handled yet. In the unlikely case that a cookie startes with hO_ it will not work correctly, unless it is marked as httpOnly. Normal cookie with that name would get registered and trash is sent back to the user. (If not an exception inside the JavaScript occurs...) In that case the Cookie header would get send still encrypted. In future versions 'h0_' will be a configureable string and there will be a protection against this kind of scenario. (f.e. the Name could also be encrypted and only if the decryption works correctly it is assumed as encrypted) There are other cases like an already existing cookie with the same name or JavaScript trying to set a h0_ cookie that are also not yet covered. But opensource is release early, release often. The whole purpose of this extension is to get a high enough download counter to finally convinve the guys at mozilla.org implement this feature into the main browser code... posted on Wednesday, October 25. 2006
great work Stefan
posted on Wednesday, October 25. 2006
Very nice! I don't know why the Mozilla people refuse to include support for this in Firefox. I posted this to digg.com as I think it needs as much attention as possible:
http://digg.com/security/The_FF2_extension_everyone_should_be_using posted on Saturday, October 28. 2006
I was looking to recompile FF to add in the HttpOnly patch released a while back when I found this plug-in.
However, I'm having a few problems with it. The main one being that it seems to find and encrypt the HttpOnly cookies OK, but these are not being returned even in PHP scripts. Looking at the cookies, I noticed that a double quote mark is added and wonder if this is some sort of bug? For example, the cookie with name: userid now becomes: "hO_userid On a security issue side, one script I tested logs you out by overwriting the log-in cookies. When I installed the extension, the 'overwriting' created new (encrypted) cookies with the "hO_ name but didn't remove the old cookie. Again, possible due to a bug in the cookie re-naming. posted on Sunday, October 29. 2006
Hi Charles,
is is possible for you to give me a site that produces this problem. (With the " mark. I am quite sure that somehow the parsing is broken in that case. And with deleted cookies. I fear you are right. I think I know the problem. I need to check for string 'deleted' before I encrypt the cookies. posted on Sunday, October 29. 2006
Hi. Here is one site (I'd be grateful if you didn't publish this comment since the site is still under construction!)
http://XXXXXXXX/XXXXXXXX I put a simple javascript on that site to alert(cookies). posted on Sunday, October 29. 2006
Hi Charles,
i have removed the URL to your demo site from the comment and approved it. Well when I visit your URL I only get an empty alert box. However the page does not try to set a Cookie. (Atleast It does not send a Set-Cookie header when I look at the HTTP response) posted on Sunday, October 29. 2006
Cookie I refer to is a login cookie and it's only set when you register/login
posted on Sunday, October 29. 2006
Ascii,
that server side protection is easily bypassed. And I do not consider anythin a protection that can be bypassed by simply changing the way code is injected. If you really want a server side protection, you can always encrypt your cookies. PHP users can simply install Suhosin and get transparent Cookie encryption. This is not only an easy way to get httpOnly Cookies, but also transparent hardening of Sessions against hijacking and fixation. posted on Wednesday, November 1. 2006
Stefan, yes it can be bypassed (as also pointed in the article with or here http://www.ush.it/team/ascii/hack-wisec-httponly_cookie/ with iframe injection) but at last you can trigger an alert when somebody try to acquire the cookie value in the standard way. It's like grep on access log locking for in GET requests but a bit more proactive. I agree with you: Suhosin (and before Hardened-PHP) is a must have patch for your PHP interpreter.
posted on Wednesday, November 1. 2006
Agree with you on the javascript 'hacks'. Not sure there is a great way to implement server side cookie protection. Currently, I'm thinking of hashing cookies with IP address but this causes hassle for anybody without a static IP. Hashing also with UA string adds only a trivial amount of protection.
Actually, it might be interesting to have an extension that forces all cookies to be HttpOnly and have a whitelist for exceptions. posted on Wednesday, November 1. 2006
Stefan,
I was testing your extension on orkut.com (google's friends networking site) and I couldn't log in with your extension activated. orkut is a site with heavy phishing schemes using javascrip to read users authentication cookies. your extension would be a plus at orkut. posted on Tuesday, December 12. 2006
#9
Brazilian
()
The extension dont work in www.orkut.com
Orkut have many bugs with cookies. Please, update the extension for Firefox. Sorry my ungly (and bad) english. posted on Thursday, December 14. 2006
#10
shiva
()
thank you for this great extension.
as somebody said, about bug. "hO_ i just found when i set cookie timeout, it causes. on session cookie with httponly on PHP5.2.3, its work well. because the timeout is closing browser(not valid date). could you check and fix it,please? i really appriciate your activity about PHP and security posted on Thursday, July 19. 2007
I can confirm that phpMyAdmin does not work with the httpOnly extension installed. My tests were with httpOnly 0.5 and phpMyAdmin 2.11.0.
posted on Tuesday, November 6. 2007
Good extension, but it breaks logging into orkut.com because the javascript on orkut.com can't seem to login without reading google.com cookies. Blogger.com doesn't seem to have the same problem though. Weird.
If you're going to be adding features, allowing certain user-defined sites to read each other's cookies would probably help. posted on Friday, August 31. 2007
Devang,
I suggest deinstalling the extension and using a recent version of Firefox. Firefox meanwhile has support for httpOnly Cookies by default. At the moment the implementation is not yet 100% secure but it is better to use the built-in functionality than the httpOnly extension. The httpOnly extension was an experiment and the first FF extension I ever wrote. So the code is not that great and it has some bugs in it. These bugs could also be the cause of your troubles. posted on Sunday, September 2. 2007
Add Comment
|
Calendar
Archives Categories Syndicate This Blog |
|||||||||||||||||||||||||||||||||||||||||||||||||


