- Send the victim’s Gmail account an email with a link you can persuade them to click on, to a page under your control
- On that page, have a <script src=”…”> tag accessing the well-known URL for getting the address book
- Gmail happily sends back the data, as the person is logged into Gmail and so the request has the correct cookies
- Override the anonymous Array() constructor with a function of your choice
- When the data arrives, the JS engine calls the anonymous Array constructor (even though it plans to throw away the result, as it’s not assigned to a variable), and therefore calls your function on the address book data, giving you access to it.
- Ajax has new security risks associated with it
Hmm. Would it break much of the web if we failed to send cookies on <script> src requests which were cross-domain?
That isn’t an Ajax attack, that is simply a url that returns js with all the contact info. This could be achieved with ns 3 :)
“Hmm. Would it break much of the web if we failed to send cookies on src requests which were cross-domain?”
Might cause ad agencies some problems, but I think that we might want to try it and see. Or, can we add a way to create cookies that are not sent cross-domain (special flag when creating them, through js or http)?
you forgot another moral: dont login to webmail
just use an email client, and take a USB key wherever you go.
> Hmm. Would it break much of the web if we failed to send cookies on src requests which were cross-domain?
It might affect “unified login systems” but other than that it sounds like a good idea to me.
* @domain-whitelist mail.google.com, gmail.com
Or maybe the whitelist could be sent va the http headers?
adriand: HTTP headers sounds like a good plan to me. Why not allow it for all content? This would allow people to set up a mechanism to stop people embedding their images to steal their bandwidth, for example. They could just set Use-Domain: http://www.mydomain.com, and the browser would refuse to display the image if it was embedded in another site. Would that be a good or a bad thing, I wonder?
> Would that be a good or a bad thing, I wonder?
Sounds pretty good to me. Of course hotlink prevention can already be achieved with .htaccess rules and such, but doing so adds an extra amount of work for the server. Shifting the duty to the client-side would be welcome.
“Would it break much of the web if we failed to send cookies on src requests which were cross-domain?”
IE6 already allows the user to block these kind of cookies as part of its P3P support. There were rumors that this behaviour would be the default in IE7.
I dunno how effective client-side remote image blocking would be, you know someone would immediately write an extension to turn it off (and I would be the first to install it).
Justin: But if site owners new that if they were to steal images protected in this way, an unknown proportion of the viewing public simply wouldn’t see them, they are much less likely to do it.
I wonder if the web sites that provide this sort of data service could protect itself by setting a login cookie and checking the referrer header: if the domain/path in the referrer header match an accepted site, then allow it. I know it is possible to spoof referrer, but spoofing that in combination with the login cookie (as long as the login cookie was set to the correct, very narrow domain) seems like it would be enough protection?
This is assuming the only ways to spoof the referrer is to use a client-side extension/modification to the browser (the system is already compromised, and much more damage can be done than just this issue), or use a proxy that alters the headers. The proxy could be browser configured, but that also seems like a client-side exploit with much more damaging consequences, or the script src request is sent to the hacker’s site, and it adjusts the request to change the referrer. But in that case, the login cookie should not travel since the domains should not match.
If all of that holds (which it may not), then it seems like it is the responsibility of the data service to adequately protect itself, and not a requirement of the browser to do extra work.
“Referer” is an optional header; you can’t write code which relies on its presence.
i wanna spoof my referrer :|