Bug 6797 - Interaction between javascript cross-frame access and cookie paths may allow cookies to be "stolen"
Summary: Interaction between javascript cross-frame access and cookie paths may allow ...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Major
Assignee: Nobody
URL: http://www.gummibears.nu/javascript/3/
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-25 11:29 PST by William Coldwell (Cryo)
Modified: 2007-12-29 18:47 PST (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Coldwell (Cryo) 2006-01-25 11:29:30 PST
Here's a discussion:
http://community.livejournal.com/lj_dev/706058.html?thread=7854602

I ran the tests from the URL above, and received a Cookie Stolen result.
Comment 1 Mark Rowe (bdash) 2006-01-25 14:35:52 PST
What appears to be happening here is that cookies are set under the paths /javascript/1/ and /javascript/2/.  In Frame Test #1, frameset is then loaded (from /javascript/3/frames.html) containing two frames.  The frameset document has no direct access to the cookies due to the path restriction.  It gains access to the cookie by accessing the child frames document.cookies.  Frame Test #2 is similar, only a frame access a sibling frames document.cookies.

The window.open test case works with popup blocking disabled.  It functions in a similar way -- it opens a  popup with window.open, and then retrieves the cookies via the popup windows document.cookies.
Comment 2 William Coldwell (Cryo) 2006-02-14 17:58:23 PST
Who should this be assigned to and should this be a P1?
Comment 3 Joost de Valk (AlthA) 2006-02-15 01:40:57 PST
Well to be honest, i don't know why it should be P1, as it is, it's assigned just fine so anyone can pick it up :) I will however cc some possible fixers.
Comment 4 William Coldwell (Cryo) 2006-04-24 00:08:07 PDT
Bueller?  Bueller?  Bueller?
Comment 5 Vladimir V. Kolpakov 2006-06-06 07:10:24 PDT
Please, please do NOT "fix" this "bug".
Please ignore RFC2965 in part of cookie Path filtering.

LJ's discussion states very clear:
"path on cookies doesn't help security"
and I agree with it.

Please don't create yet another "improvement",
which would be the real pain with AJAX.

Even if you fix this (close direct opportunity for JS),
other embedded objects, such as <img>, <link>, <object> etc.,
can have cookie in http header, -- and web programmers will
find way around, increasing mess, lowering secirity.

I have seen that Safari does not attach cookie for CSS <link>,
wherever other browsers do.
Could you please re-focus on fixing such real bugs,
instead create more incompatibility problems for server-side programmers?

Thank you in advance.
--Vladimir

Url with test and details:
  http://www.sfgate.com/cgi-bin/safari/first/start


  
Comment 6 Ian 'Hixie' Hickson 2007-05-24 15:25:58 PDT
This is INVALID. There would be many ways to get around the restriction even if we had one.
Comment 7 Sam Weinig 2007-12-29 18:47:16 PST
I agree with Ian.  This is definitely INVALID.  Marking it as such.