- BetterExplained - https://betterexplained.com -

Gmail Contacts Flaw: Overview and Suggestions

There’s news and discussion about a recent flaw in Gmail that can expose your contact list to any page.

Summary: If you are logged into a Google account (email, personal homepage, etc) then another site can use that authentication to access your contact list. Log out before visiting sites you semi-trust.

This is an example of Cross Site Request Forgery – you learn something new every day. There’s a detailed writeup here on the gmail flaw.

Update (1/1/07): The flaw appears to be fixed.

How it works

The code is pretty straightforward. Basically, Google docs has a script that runs a callback function, passing it your contact list as an object. The script presumably checks a cookie to ensure you are logged into a Google account before handing over the list.

Unfortunately, it doesn’t 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 and get the contact list as an object. Since you are logged in somewhere, your 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 importance of your contacts.

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:

It’s interesting to think of solutions to this problem – do you have any others?

I’m sure Google will have this fixed, but beware browsing random sites on the net (obvious, yes, but be especially wary). Log out of Google first.

This is a wake-up call about the realities of Web security.

Other Resources