Skip to main content

Bounty leftover Part #2 (target Google)

In my previous blog post I mentioned a following post about some vulnerability I found in https://accounts.google.com/.
As said, motivated from my little success that I got finding a vulnerability in some obsolete authorization service in Facebook I thought I might have the same luck with Google :)
Well it turned out this was the case...
Giving a look at the Older Protocols in the Google Accounts Authentication and Authorization page something that immediately caught my attention was the AuthSub (deprecated) flow.
Now, I am not going to describe here the flow, it is enough saying that it is a pre-OAuth flow that Google used to give some access delegation using some sort of tokens...
The problem was related with the scope parameter in www.google.com/accounts/AuthSubRequest. It accepted concatenation of string after a valid scope. 
E.g. 

https://accounts.google.com/AuthSubRequest?next=http%3A%2F%2Flocalhost%3A8080%2Fa&scope=http%3A%2F%2Fwww.google.com%2Fcalendar%2Ffeeds%2F/%3Cscript%3Ealert%28%27hello%27%29%3C/script%3E&session=1&secure=0&hd=default

So far so good.
The next natural step would have been to use the https://developers.google.com/accounts/docs/AuthSub#AuthSubTokenInfo to get the scope back with the given stored javascript.
At a first sigh this looked like unexploitable since as per doc this would require a request header, namely 

curl -H "Authorization:AuthSub token="1/XD7eCi3_
2mXSfDHXLtImg0Oc1nDoZCFKL4dLrqzVYVk"" -H "application/x-www-form-urlencoded" https://www.google.com/accounts/AuthSubTokenInfo

The reality though was that it existed also another version of the service that accepts request parameter (and the cherry on top was that this service also runs in https://accounts.google.com that is the most rewarded according to https://www.google.ch/about/appsecurity/reward-program/).

So

curl -v https://accounts.google.com/accounts/AuthSubTokenInfo?oauth_token=1/BWAFgricOqhNMPTcHsPy0MRlKbMWE-HNMjlLtT0NNPA

> User-Agent: curl/7.30.0

> Host: www.google.com

> Accept: */*

>

< HTTP/1.1 200 OK

< Content-Type: text/plain; charset=UTF-8

< X-Frame-Options: DENY

< Date: Thu, 07 Aug 2014 20:10:51 GMT

< Expires: Thu, 07 Aug 2014 20:10:51 GMT

< Cache-Control: private, max-age=0

< X-Content-Type-Options: nosniff

< X-XSS-Protection: 1; mode=block

< Content-Length: 106

< * Server GSE is not blacklisted

< Server: GSE

< Alternate-Protocol: 443:quic

<

Target=localhost

Secure=false

Scope=http://www.google.com/calendar/feeds//<script>alert('hello')</script>


Some observations:

  • the scope is not sanitized (so he can lead to a XSS ) but
  • no sniff is present
  • Content Type is text/plain
To conclude this is the attack scenario


Once reported Google fixed it pretty soon and also got a reward for it... Not bad for a left over :p

Thanks Google security.

Comments

Popular posts from this blog

Slack SAML authentication bypass

tl;dr  I found a severe issue in the Slack's SAML implementation that allowed me to bypass the authentication. This has now been solved by Slack.
Introduction IMHO the rule #1 of any bug hunter (note I do not consider myself one of them since I do this really sporadically) is to have a good RSS feed list.  In the course of the last years I built a pretty decent one and I try to follow other security experts trying to "steal" some useful tricks. There are many experts in different fields of the security panorama and too many to quote them here (maybe another post). But one of the leading expert (that I follow) on SAML is by far Ioannis Kakavas. Indeed he was able in the last years to find serious vulnerability in the SAML implementation of Microsoft and Github. Usually I am more an "OAuth guy" but since both, SAML and OAuth, are nothing else that grandchildren of Kerberos learning SAML has been in my todo list for long time. The Github incident gave me the final…

Bug bounty left over (and rant) Part III (Google and Twitter)

tl;dr in this blog post I am going to talk about some bug bounty left over with a little rant.

Here you can find bug bounty left over part I and II
Here you can find bug bounty rant part I and II
Introduction In one of my previous post I was saying that: 

"The rule #1 of any bug hunter... is to have a good RSS feed list."
Well well well allow me in this post to state rule #2 (IMHO)

"The rule #2 of any bug hunter is to DO NOT be to fussy with 'food' specifically with left over"

aka even if the most experience bug hunter was there (and it definitely was my case here, given the fact we are talking about no one less than filedescriptor) do not assume that all the vulnerabilities have been found! So if you want some examples here we go.
Part I - GoogleI have the privilege to receive from time to time Google Vulnerability Research Grant. One of the last I received had many target options to choose from, but one in particular caught my attention, namely Google Issue T…

How to try to predict the output of Micali-Schnorr Generator (MS-DRBG) knowing the factorization

The article was modified since its publication. Last update was 09/10/2017 

tl;dr in this post we are going to describe how to try predict the output of Micali-Schnorr Generator (MS-DRBG)  knowing the factorization of the n value. If this sounds like, "why the hell should I care?", you might want to give a look at this great post from Matthew Green about the backdoor in Dual_EC_DRBG. But In a nutshell, quoting Matthew Green : Dual_EC_DRBG is not the only asymmetric random number generator in the ANSI and ISO standards (see at the bottom).   it’s not obvious from the public literature how one would attack the generator even if one knew the factorization of the n values above. What I am NOT claiming in this post though is that there is a backdoor in one of this standard.

Introduction
The first time I heard about this problem is about couple of weeks ago via this Matthew's tweet: As a curiosity, the NSA didn’t just standardize Dual EC, they also standardized a second sketchy …