Skip to main content

Billion Laugh Attack in https://sites.google.com

tl;dr https://sites.google.com suffered from a Billion Laugh Attack vulnerability that made the containerized environment to crash with a single invocation.

Introduction

Few months ago I applied for a talk at a security conference titled So you wanna be a Bug Bounty Hunter but it was rejected :(. The reason behind it is that I have been on/off in the bug bounty business for a while as you can see here:
and I would have liked to share some of the things I have learned during these years (not necessary technical advises only). You can find a couple of these advises here:


Rule #1 of any bug hunter is to have a good RSS feed list

and here


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

Today's rule is:
The rule #3 of any bug hunter is DO LOOK at the old stuff

and I hope you will understand why with the next picture.

Looking at https://sites.google.com

For some reasons I can't remember I was looking at  https://sites.google.com and my attention was caught by something in the bottom left corner:


Well do you know what I mean? Considering what I have said above the words "Classic Sites" it is an immediate trigger for my bug bounty mind. So I decided to give a look at this "Classic Sites" and I spotted indeed something interesting:

Using this gadget functionality it is possible to import and XML based gadget to be display to the website. When I see XML import the normal connection for any security person is XXE, so I decided to give a try.
I quickly discovered that Google sites implements this functionality using Apache Shinding (an old Apache project now in attic). A quick inspection in the source code (at the end is an open source project :p) showed that the code was safe regarding SSRF and exfiltration but it would be vulnerable to Billion Laugh Attack. And it is basically when I did a Tweet poll:
After having a chat with few people I have decided to report this to Google and to ask the permission to poke the site for Billion Laugh Attack. And it is basically what I did. As usual Google security was great and gave me the permission to give a try. To be fair they were a bit skeptic that this would actually work but yeah it would not have been a big deal in any case since the target was a  containerized environment. So I tried to import an XML with the most classic of the Billion Laugh Attack payloads. And guess what It kind of worked:
Again not a big deal Google side due the virtualized environment. This was quickly fixed as you can see here:

org.apache.shindig.common.xml.XmlException: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK. At: (1,1)

I was actually a bit surprised by this since in Java  the default value of entityExpansionLimit was set to  64000 already in JRE 1.7_45. Does it mean that Google was running a really old version of Java or maybe they were just defaulting to a different value. I do not know.

Summary

Google usually doesn't pay a bounty for DOS vulnerabilities but they did a little exception this time paying a 500$ bounty. As usual big thank to the Google security team and to Roberto Clapis for help.

For more XML trickery follow me on Twitter.  

Comments

Popular posts from this blog

Top 10 OAuth 2 Implementation Vulnerabilities

Some time ago I posted a blogpost abut  Top 5 OAuth 2 Implementation Vulnerabilities.
This week I have extended the list while presenting Top X OAuth 2 Hacks at OWASP Switzerland.

This blog post (like the presentation) is just a collection of interesting attack OAuth related.

#10 The Postman Always Rings Twice  I have introduced this 'attack' in last year post . This is for provider implementer, it is not extremely severe but, hey, is better to follow the spec. Specifically

The client MUST NOT use the authorization code  more than once.  If an authorization code is used more than once, the authorization server MUST deny the request and SHOULD revoke (when possible) all tokens previously issued based on that authorization code.

It turned out that even Facebook and Googledid it wrong... :)

#9 Match Point To all OAuth Providers be sure to follow section 4.1.3 of the spec in particular

...if the "redirect_uri" parameter was included in the initial authorization requ…

OpenSSL Key Recovery Attack on DH small subgroups (CVE-2016-0701)

Usual Mandatory Disclaimer: IANAC (I am not a cryptographer) so I might likely end up writing a bunch of mistakes in this blog post...

tl;dr The OpenSSL 1.0.2 releases suffer from a Key Recovery Attack on DH small subgroups. This issue got assigned CVE-2016-0701 with a severity of High and OpenSSL 1.0.2 users should upgrade to 1.0.2f. If an application is using DH configured with parameters based on primes that are not "safe" or not Lim-Lee (as the one in RFC 5114) and either Static DH ciphersuites are used or DHE ciphersuites with the default OpenSSL configuration (in particular SSL_OP_SINGLE_DH_USE is not set) then is vulnerable to this attack.  It is believed that many popular applications (e.g. Apache mod_ssl) do set the  SSL_OP_SINGLE_DH_USE option and would therefore not be at risk (for DHE ciphersuites), they still might be for Static DH ciphersuites.
Introduction So if you are still here it means you wanna know more. And here is the thing. In my last blog post I was …