Skip to main content

Beware what you click

Usually my (not too many :( ) posts are written for a technical audience (not too big :( ). This time, given the fact October is Cyber Security Month I will try to put some effort to try to explain how you can keep yourself away from annoyances. Well the rule of thumb is actually extremely simple and can be resumed with a simple sentence:

 Beware what you click

Let me repeate it: "beware what you click" :)
Just following this simple rule you can avoid 90% of scam/viruses and phishing attacks.
But lets do a step back. Assuming you know already what is a computer's virus let me explain what is a phishing attack. Phishing scam uses legitimate-looking websites to trick a victim into sharing their username, password or other  sensitive information. Pishers will design their sites to look exactly like e.g. the website of your mail provider, your bank, credit card issuer, or another financial institution. The hope is that you won't realize you are on the wrong site, and just punch your password like you normally would. Then, they use it to log into your accounts and e.g. transfer out your money.
So here some advice for you:
  • Look carefully at a website before giving any information (specially sensitive data)
  • Especially look out for slightly misspelled words
  • If something looks even a little fishy, delete the mail and close the site ASAP
  • Create bookmarks in your browser for commonly used sites (e.g. mail, bank, etc)
  • But overall

     Beware what you click

Non GEEK can STOP here :) Now let me show some example of phishing based on an open redirect I found on Google-Github OAuth integration :) This is a variant of the 'Lassie Come Home' OAuth attack I previously talked about.  In is possible to connect a project with Github. So far so good :) The problem is that the Google's OAuth client id registered in github (namely fde1c8c8834c1b0adcc8) has a registered redirect_uri that is too open (namely This is because the same OAuth client id is used for every Google project to connect with github. For example project APPS_A when connects to Github will end up having this request to the github authorization endpoint:

and APPS_B will have

Note that the same client_id is used in both requests. This is possible because as said above the registered redirect uri is Github validates only the start of the URI (as clearly stated here) and considers valid redirect uri if everything else is appended after the registered redirect uri. In our example the registered redirect uri is so github will consider valid so in our case and are both valid and Google leverages happily this features :) Another thing to notice is that in Github once you authorize the application once the consent screen is not shown anymore namely the redirect will happen *without* human interaction.

So what an attacker needs to do is to upload an html file in the Google Cloud Storage Bucket and apply some open permission in order to be read by anyone (or by at least by the victim).
The html file will have a fixed uri of Notice that this is a valid redirect URI for fde1c8c8834c1b0adcc8 since it start with

So now  is possible to forge the initial OAuth call like this: this will redirect to

Mind that test.html is controlled by the attacker.

To recap the attack looks like this:
  • the attacker forge an url like
  • the victim clicks the link
  • this will redirect to
This is how a successfully phishing attack can be conducted (if the victim trusts Github or Google would be even simpler since the URL used in the attack are "familiar" domains for the victim).

As a consequence Google decided to tighten the redirect_uri in github (now is

Final note, (unlikely for me) but good for Google:
otherwise I could as well steal the Authorization Code!!


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