Skip to main content

Billion Laugh Attack in

tl;dr suffered from a Billion Laugh Attack vulnerability that made the containerized environment to crash with a single invocation.


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

For some reasons I can't remember I was looking at 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.


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.  


Popular posts from this blog

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 bl

The Curious Case of WebCrypto Diffie-Hellman on Firefox - Small Subgroups Key Recovery Attack on DH

tl;dr Mozilla Firefox prior to version 72 suffers from Small Subgroups Key Recovery Attack on DH in the WebCrypto 's API. The Firefox's team fixed the issue r emoving completely support for DH over finite fields (that is not in the WebCrypto standard). If you find this interesting read further below. Premise In this blog post I assume you are already knowledgeable about Diffie-Hellman over finite fields and related attacks. If not I recommend to read any cryptography book that covers public key cryptography. Here is a really cool simple explanation by David Wong : I found a cooler way to explain Diffie-Hellman :D — David Wong (@cryptodavidw) January 4, 2020 If you want more details about Small Subgroups Key Recovery Attack on DH I covered some background in one of my previous post ( OpenSSL Key Recovery Attack on DH small subgroups (CVE-2016-0701) ). There is also an academic pape r where we examine the issue with some more rigors.

All your Paypal OAuth tokens belong to me - localhost for the win

tl;dr   I was able to hijack the OAuth tokens of EVERY Paypal OAuth application with a really simple trick. Introduction If you have been following this blog you might have got tired of how many times  I have stressed out the importance of the redirect_uri parameter in the OAuth flow. This simple parameter might be source of many headaches for any maintainer of OAuth installations being it a client or a server. Accepting the risk of repeating myself here is two simple suggestions that may help you stay away from troubles (you can always skip this part and going directly to the Paypal Vulnerability section): If you are building an OAuth client,   Thou shall register a redirect_uri as much as specific as you can i.e. if your OAuth client callback is then DO register   NOT JUST h ttps:// or If