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

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

Critical vulnerability in JSON Web Encryption (JWE) - RFC 7516

tl;dr if you are using go-jose , node-jose , jose2go , Nimbus JOSE+JWT or jose4j with ECDH-ES please update to the latest version. RFC 7516 aka JSON Web Encryption (JWE) hence many software libraries implementing this specification used to suffer from a classic Invalid Curve Attack . This would allow an attacker to completely recover the secret key of a party using JWE with Key Agreement with Elliptic Curve Diffie-Hellman Ephemeral Static (ECDH-ES) , where the sender could extract receiver’s private key. Premise In this blog post I assume you are already knowledgeable about elliptic curves and their use in cryptography. If not Nick Sullivan 's A (Relatively Easy To Understand) Primer on Elliptic Curve Cryptography or Andrea Corbellini's series Elliptic Curve Cryptography: finite fields and discrete logarithms are great starting points. Then if you further want to climb the elliptic learning curve including the related attacks you might also want to visit https://s

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 pic.twitter.com/DlPvGwZbto — 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.