“We’d actually received an earlier report from another researcher regarding this same issue. In response to that report, we’ve been working on limiting this behavior when it comes to our official apps, since they’re pre-authorized. For other apps, unfortunately, fully preventing this would mean requiring any site integrating with Facebook to use HTTPS, which simply isn’t practical for right now.” reported Facebook security team.
Let’s assume that the victim is using Skype then the attacker can get an access_token with the full permissions of that application by injecting this basic iframe into any webpage that the victim visits:
<iframe src=https://www.facebook.com/dialog/oauth?redirect_uri=http%3A%2F%2Flogin.skype.com%2Flogin%2Foauth%3Fapplication%3Daccount&client_id=260273468396&response_type=token width=0 height=0>
“Facebook will accept the HTTP link at the redirect_uri parameter so a GET request would be sent and the user/victim will get a 302 redirect to that HTTP URL with the access_token value of the application with all of its permissions! Then It’s done now and an access token with expires=[the current expiry value] (usually it’s 0 with Skype and 0=never) is coming for you now to intercept and exploit!> very easy, isn’t it?” reported the expert’s post.
In general an attacker can use this URL/vector (http%3A%2F%2Fwww.facebook.com%2Fconnect%2Flogin_success.html&response_type=token&client_id=[app_id]) as redirect_uri parameter.
The problem is that Facebook allows the HTTP version of the Canvas URL to be used even if the app already has an HTTPS URI (i.e Although Skype has a HTTPS Canvas URL, Facebook allows the HTTP link in redirect_uri parameter) and also Facebook allows the request without any special tokens so anyone can make a request.
Facebook users can prevent Man-In-The-Middle attacks using HTTPS to encrypt traffic that contains sensitive information and following penetration tester’s suggestions:
1- Use “HTTPS Everywhere” Browser Extension(https://www.eff.org/https-everywhere)
2- Don’t use any popular app that doesn’t use a SSL (Secure Socket Layer) because HTTPS Everywhere won’t help you in this case then!