GMail Vulnerable To Contact List Hijacking
Posted by
Hemos
on Mon Jan 01, 2007 10:09 AM
from the in-special-circumstances dept.
from the in-special-circumstances dept.
Anonymous Coward writes "By simply logging in to GMail and visiting a website, a malicious website can steal your contact list, and all their details. The problem occurs because Google stores the contact list data in a Javascript file. So far the attack only works on Firefox, and doesn't appear to work in Opera or Internet explorer 7. IE6 was un-tested as of now."
This discussion has been archived.
No new comments can be posted.
GMail Vulnerable To Contact List Hijacking
|
Log In/Create an Account
| Top
| 139 comments
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Which is the problem? (Score:5, Insightful)
Re:Which is the problem? (Score:5, Informative)
It's an information leak (Score:5, Informative)
(http://markbyers.com/ | Last Journal: Monday July 24 2006, @12:54PM)
It can be exploit by writing a callback function in Javascript, that can do anything, and then passing it to the above link, which gives your function all the users contact info.
Re:Which is the problem? (Score:5, Insightful)
GMail. JSON should not be used for sensitive data because any old website can reference it simply by including it as an external script. The Google developers should not have used JSON for this information, they did, and that is why this information leak exists. There are ways to protect JSON from this (e.g. nonces) but you have to actually add this security yourself, rather than relying on the browser's built-in cross-domain security like you could if you were using XML etc.
Re:Which is the problem? (Score:5, Informative)
(http://www.bowlie.com/forum/)
When you surface data via Xml web services, you can only call the web service on the domain that the JavaScript calling it originates from. So if you write your web services with AJAX in mind exclusively, then you have made the assumption that JavaScript is securing your data.
The problem is created at two points:
1) When you rely on cookies to perform the implicit authentication that reveals the data.
2) When you allow rendering of the data in JSON which bypasses JavaScript cross-domain security.
This can be solved by doing two things:
1) Make one of the parameters to a web service a security token that authenticates the request.
2) Make the security token time-sensitive (a canary) so that a compromised token does not work if sniffed and used later.
The security token should be gathered by authenticating the user according to a mechanism that the user controls. Think of the way that the Flickr API asks you to grant an application access to your data.
Anyhow, use the noscript extension in Firefox to ensure that your data is not compromised, as you will be able to choose to block the script from running, and in doing so prevent others from gaining access to your data.
The Internet Exporer alternative is to disable JavaScript, but few people ever do this because too few sites (especially Web2.0 sites) degrade gracefully when JavaScript is disabled.
Submitter has a problem with Firefox? (Score:5, Informative)
(http://ctho.ath.cx/)
I've tried the hack on IE7, Opera, and Firefox; it appears to be working on all three.
Does the submitter have some agenda against Firefox?
Re:Submitter has a problem with Firefox? (Score:5, Informative)
* supports cookies
* supports loading of resources from domains other than the one the currently-loaded page is hosted on
* supports accessing those resources
ie pretty much all (modern) browsers.
Phew! (Score:4, Funny)
Works in most any java-script browser (Score:5, Insightful)
(http://www.entangledstates.org/ | Last Journal: Tuesday March 05 2002, @02:24PM)
http://www.digg.com/programming/GMail_Hacked_VisiRe:How does this work (Score:4, Informative)
(http://dolphinling.net/ | Last Journal: Thursday March 23 2006, @04:04PM)
Re:How does this work (Score:5, Informative)
(Last Journal: Saturday February 25 2006, @11:02PM)
1. Gmail sets a cookie saying you're logged in
2. A [3rd party] javascript tells you to call Google's script
3. Google checks for the Gmail cookie
4. The cookie is valid
5. Google hands over the requested data to you
If [3rd party] wanted to keep your contact list, the javascript would pass it to a form and your computer would happily upload the list to [3rd party]'s server.
At no point does [3rd party] make any request to Google.
Why do I bother with this site? (Score:5, Insightful)
(Last Journal: Monday November 15 2004, @12:47PM)
"So far the attack only works on Firefox, and doesn't appear to work in Opera or Internet explorer 7"
TFA says:
"I've tried the hack on IE7, Opera, and Firefox; it appears to be working on all three."
Got any jobs going? I could do nice armchair job at Slashdot. I'd be willing to work the full 3 hours a week.
Re:Why do I bother with this site? (Score:5, Funny)
(Last Journal: Friday January 13 2006, @02:08PM)
Not with that sentence structure. You only made one grammar error. You could never be a
Thank goodness (Score:4, Funny)
Conceptual problem (Score:5, Informative)
Not valid JSON, is it? (Score:2)
Wow! (Score:2, Funny)
(http://nyud.info/ | Last Journal: Sunday February 11 2007, @09:35AM)
Oh wait...
Fixed? (Score:4, Informative)
http://blogs.zdnet.com/Google/?p=434
it is fixed.
Not Fixed (Score:5, Informative)
(http://tron.lir.dk/ | Last Journal: Friday November 02 2001, @02:17PM)
Still works for me. You can run this script from a local html file to check:
s how=ALL&psort=Affinity&callback=google&max=99999"> </script></head>
<html>
<head>
<script>
function google(a) {
document.write("<ol>");
for (i = 0; i < a.Body.Contacts.length; i++) {
document.write("<li>" + a.Body.Contacts[i].Email + "</li>");
}
document.write("</ol>");
}
</script>
<script src="http://docs.google.com/data/contacts?out=js&
<body>
Hello
</body>
</html>
Galeon too (Score:2, Informative)
Can be solved with HTTP referer (Score:1)
The Web browser as application portal (Score:2)
(Last Journal: Sunday November 06 2005, @05:24PM)
With the Web browser becoming an application portal, users need to understand that doing transactions that involve their personal data must be separate from general Web browsing.
You can switch off cookie permission and Javascript but this limits the functionality of many sites. I think the best solution is to use two different browsers, one for personal transactions, the other for wandering the Web.
Wow (Score:4, Informative)
Don't volunteer that much info to Google (Score:2, Interesting)
GMail is beta (Score:2, Funny)
(http://www.ascii-lp.com.ar/)
Doesn't work in Opera 9.02 (Score:2)
(http://dvd-hq.info/)
Explanation & Possible Solutions (Score:2, Interesting)
(http://instacalc.com/)
Quick follow-up. On digg someone posted the un-obfuscated code: http://www.cc.gatech.edu/~achille/contacts-source
How it works
The code is pretty straightforward. Basically, Google docs has an embedded script that will run a callback function, passing the function your contact list as an object. The embedded script presumably checks a cookie to ensure you are logged into a Google account before handing over the list.
Unfortunately, the script doesnt check what page is making the request. So, if you are logged in on window 1, window 2 (an evil site) can make the function call. Since you are logged in somewhere, the cookie is valid and the request goes through.
Also, if you check the object that is returned, you see fields for the contact's name, email and "affinity". Presumably, a higher affinity means a more-emailed contact, so it may be possible to know the relative weight of links.
Possible solutions
Google is run by smart people and I'm sure they'll have this fixed soon. A few suggestions appear to be popping up, all centered on making sure the user is on a Google.com page and not a random site:
Referrer blocking: Block all requests from sites not in the google.com domain. However, some people run referrer-blocking software. It may be the price they have to pay for security, but there could be other consequences.
Script checks: An idea I had was to check the window.location (just like you check the cookie) to make sure it's coming from a google.com domain. This is another way to see what page is making the request.
Challenge-response: Google pages (like Gmail) can have some token or unique, computed data that they submit with their requests. Random pages won't have access to this token when they make the function call.
(From user JRF on reddit): Include part of cookie in the request URL as a unique token that only a "real" Google page would know. Need to watch out for proxies/browser history (accessible from other pages) being able to access this unique data. May need to seed or salt it in a challenge-response system.
It's interesting thinking of fixes for this - do you have any other suggestions for how Google would fix this?
First link in the aritcle (Score:1)
Some details on how it works (Score:2)
(http://getahead.org/blog/joe/ | Last Journal: Monday August 25 2003, @02:52AM)
not anymore (Score:1)
(http://knockknockbobbobsaget.blogspot.com/)
Fixed (Score:2)
(http://jfctravelclub.com/travelblog/)
What A Waste (Score:1)
My solution (Score:2)
(http://slashdot.org/~xnormal)
Not perfect, but it works for me.
Re:Some Background Information (Score:1)
Re:Some Background Information (Score:1)
Second: If you take
http://googlified.com.googlepages.com/contactlist
and just strip the html page and go to:
http://googlified.com.googlepages.com/ [googlepages.com]
You'll find a link to googlified.com
Some things are so simple they're complicated I guess.