Skip to main content

Are your github's data safe?

Sure they are, if you do not user Firefox (even the last  version) or if you do not use iOs 6.1 or some older version of IE they are really safe :)
In the last few days I got the pleasure to be in touch with the github security guys.
I must admit I am really impressed about how security is important for Github and how much serious they take it (they embrace and leverage all the new security features supported by modern browsers, Content Security Policy included ).
Moreover they are really fast on reply and really friendly so kudos to them.
From the other hand I was a bit surprised on how the "handled" a couple of issues I did report.
Now the fact I did not get a bounty doesn't play any role on my opinion (apparently both issues I reported were well known by them).
The thing that does surprise me instead is the fact that even that those are well known issues are not yet fixed (if ever).
But no more words just fact...

The first issue I reported is the following.

The .patch selector in github.com is vulnerable to XSS indeed if a patch contains javascript this is not correctly sanitized. Live example in here.

Now I do appreciate that

a) nosniff is present
b) the content type is text/plain

but older browsers do ignore those and execute the javascript. One example is Safari for iPhone (that is actually not too old) and obviously older version of IE.
Now we are really talking about stealing cookies on a really sensitive domain right ? (always IMHO) :)
But apparently this is not enough and that output will continue to be not sanatized.

So this brings us to issue #2

Step to reproduce
- Create a new public repo e.g. (https://github.com/asanso/test)
- add a configuration config.txt file and put username and password
user="foobar"
password="supersecret"
- commit and push
- verify anybody can see https://github.com/asanso/test/blob/master/config.txt
- verify anybody can see https://raw.githubusercontent.com/asanso/test/master/config.txt
- change the permission of https://github.com/asanso/test to private
- verify nobody apart asanso can see https://github.com/asanso/test/blob/master/config.txt
-  verify nobody apart asanso can see https://raw.githubusercontent.com/asanso/test/master/config.txt

Create html and make the victim asanso visit the page

<script src="https://github.com/asanso/test/raw/master/config.txt">
<script>alert(user+'\n'+password)


This extrafiliates the credentials to an attacker... 

Now, true, this will work only in Firefox since doesn't have any support for nosniff .
But isn't Firefox still one of the most used browser or am I missing something :) ?
Moreover Firefox will probably fix this issue sooner or later but what until then ?
Said that,  I just (without any irony) want to reiterate : "Great stuff Github security" (they are seriously good!!)


 

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…

Cross-origin brute-forcing of Github SAML and 2FA recovery codes

Yesterday while reading my Twitter stream I found this interesting article about  downloading GitHub SSO bypass codes. Same as Yasin Soliman I was invited to a Github pre-release of the organisation SAML single sign-on (SSO) private program. And same as him I found an issue in the same endpoint. So I thought to write a quick blog post about it. Github already published a tl;dr about this,



 I will try to fill the blanks here.

As mentioned by Yasin, Github offers an endpoint where privileged users can recover bypass codes. These recovery codes were accessible for download as plaintext and had the content-type as text/plain, something like:



What immediately caught my attention was that the format of the code forms (with some exceptions) a valid JavaScript file with lines in the format of XXXXX-XXXXX, ten hex digits separated by a hyphen. This is interpreted in JavaScript as the subtraction of two variables! This remember an old blog post of mine where I could possibly exfiltrate informa…