rks. Given a cookie file beginning with
.infoseek.com InfoSeekUserID ...cookiedata...
cg
i.netscape.com NETSCAPE_VERIFY ...cookiedata...
the browser will send InfoSeekUserID's data only to addresses matching .infoseek.com; that is, only to servers in the domain from which the InfoSeekUserID cookie was sent. Similarly, NETSCAPE_VERIFY will go only to cgi.netscape.com, the server that created that cookie.
I got this wrong because I thought that, when parsing the client's data, the server ended up with an environment that looks like this:
InfoSeekUserID data
NETSCAPE_VERIFY data
The server could get at any cookie's data by matching its name, if known. In fact, there's only one cookie-related CGI variable, HTTP_COOKIE, whose value is the concatenation of cookie entries
that match the server's domain
. Unfortunately, since the machine I happened to test on had only cookies I had put there, and no others, I got the wrong impression that the browser sent
all
cookie data, not just that matching the server's domain.
Another rea
son I got this wrong was that I'd been told by a hacker whose skills I respect that it was trivial to pick off unauthorized cookie data. Maybe so, but it's not as trivial as you might think. Out of curiosity, I tried to see how I could steal unauthorized cookie data. I got as far as the following three steps:
1
I noted that JavaScript can do file:/// URLs, so you can, for example, do this...
document.location = "file:///c:/program files/netscape/navigator/cookies.txt"
...and cause a browser to load the cookie file on a Windows box running Navigator.
2
I remembered from Rex Baldazo's column (
http://www.byte.com/art/9608/sec9/art1.htm
) that you can create a hidden frame. So, step 1 could occur invisibly.