Bug 330751 - Bypassing HttpOnly cookie in Konqueror
Summary: Bypassing HttpOnly cookie in Konqueror
Status: CONFIRMED
Alias: None
Product: konqueror
Classification: Applications
Component: kcookiejar (show other bugs)
Version: unspecified
Platform: unspecified Unspecified
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-04 13:46 UTC by Dawid Czagan
Modified: 2014-03-05 23:05 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Simple code to play with the issue (393 bytes, text/html)
2014-02-14 10:35 UTC, Dawid Czagan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dawid Czagan 2014-02-04 13:46:43 UTC
Konqueror prevents JavaScript from reading cookies with HttpOnly flag (and this is good - it works as expected), but it turns out that Konqueror allows JavaScript to overwrite HttpOnly cookies. As a consequence the attacker can launch session fixation attack and finally impersonate the victim - the attacker just overwrites the HttpOnly cookie of the victim (session fixation via HttpOnly cookie). As a result of session fixation attack, the attacker can impersonate the victim, because he knows the victim's session ID. This is how HttpOnly flag can be bypassed in Konqueror. 

Regards,
Dawid Czagan

Reproducible: Always
Comment 1 Dawit Alemayehu 2014-02-10 19:33:09 UTC
Which browser engine did you use to test this? webkit or khtml?
Comment 2 Dawid Czagan 2014-02-11 09:12:49 UTC
KHTML
Comment 3 Dawit Alemayehu 2014-02-13 13:37:59 UTC
Do you by any chance have a test case for this? Otherwise, I will have to create a test case which might take a while.
Comment 4 Dawid Czagan 2014-02-13 16:57:12 UTC
I have a simple PHP site created to play with this issue (if you are interested, I will paste the code here). By the way - when are you going to fix this issue?
Comment 5 Dawit Alemayehu 2014-02-13 23:21:25 UTC
Feel free to post the script. I am already looking into it now and hopefully will get a fix out before the 4.12.3 release.
Comment 6 Dawid Czagan 2014-02-14 10:35:28 UTC
Created attachment 85145 [details]
Simple code to play with the issue

Run it, refresh and see that JavaScript was able to overwrite cookie1, which has HttpOnly flag set).
Comment 7 Dawit Alemayehu 2014-03-01 04:52:25 UTC
This is probably a WONTFIX for the same reasons outlined by the Firefox developers in
https://bugzilla.mozilla.org/show_bug.cgi?id=607613

Read the discussion in that ticket and see the security considerations section 8 under 
http://www.rfc-editor.org/rfc/rfc6265.txt
Comment 8 Dawid Czagan 2014-03-05 23:05:47 UTC
JavaScript can't overwrite HttpOnly cookies in Firefox (I tested it). BTW there is no reason to allow JavaScript to overwrite HttpOnly cookies and this overwriting can only lead to problems. Moreover, it turns out, that majority of browsers don't allow the aforementioned overwriting. Please let me know if you are going to fix this problem in Konqueror.