News for hackers. Stuff that matters.
Re:Achilles Heel of OAuth or Why Facebook Adds #_=_ by tlogan on Friday March 15, 2013 @02:00AM (#5379409)
I'm not sure if I understand this problem or security hole here. When I write some OAuth application I need to register my redirect_url. So how somebody can steal access token / code?
Re:Achilles Heel of OAuth or Why Facebook Adds #_=_ by icambron on Friday March 15, 2013 @02:41AM (#5379465)
If I understood, it works like this:

1. You register foo.com as your redirect with FB. Your oauth endpoint is actually foo.com/fbauth, but Facebook is OK with just the domain.

2. Somewhere else on your site, you allow open redirects, like maybe a user can create a link that you proxy with a redirect for click-tracking purposes, like foo.com/links?url=evil.com

3. An attacker makes an oauth query to Facebook with the redirect URL hacked so that it points at foo.com/links?url=evil.com

4. FB dutifully sends your user to the hacked URL, which redirects to evil.com with all of its hashy stuff in place.

5. Javascript on evil.com reads the hash and uploads it

It's not clear--and I'm too lazy to test--whether FB will restrict the forward to foo.com/fbauth if you're explicit about it when configuring your app. But certainly the wording on the developer console just asks for your site URL, and even though I'm pretty familiar with oauth, I have never bothered to do more than that. Google, on the other hand, forces you to.

Re:Achilles Heel of OAuth or Why Facebook Adds #_=_ by tlogan on Friday March 15, 2013 @02:51AM (#5379479)
Thanks for explanation. May I ask how the attacker can make "an oauth query to Facebook with the redirect URL hacked so that it points at foo.com/links?url=evil.com"? Are you saying that attacker somehow convinces user to visit maliciously created Facebook authentication URL?
Re:Achilles Heel of OAuth or Why Facebook Adds #_=_ by icambron on Friday March 15, 2013 @03:26AM (#5379550)
Right, I worded that poorly. You need some other vulnerability for the attacker to pull this trick off. But, like homokov says, there are a lot of possibilities for that. Obviously, such a vulnerability is bad on its own and the site owner should prevent it, but FB should be better about mitigating it from their end.
Re:Achilles Heel of OAuth or Why Facebook Adds #_=_ by homakov on Friday March 15, 2013 @03:06AM (#5379511)
not precisely visit, any CSRF technique can be useful. <iframe, window.open
Re:Achilles Heel of OAuth or Why Facebook Adds #_=_ by homakov on Friday March 15, 2013 @02:07AM (#5379415)
you register not full path+query, only domain. Every website has huge attack surface
Re:Achilles Heel of OAuth or Why Facebook Adds #_=_ by klapinat0r on Friday March 15, 2013 @06:50AM (#5379924)
Sorry if I misunderstand, but would that mean that (along with what you wrote about whitelist/static) a "replace hash values", for instance, would mitigate the attack?

I currently have a OAuth (1.0a) implementation down the road (and would be very willing to hiring you when we begin). Am I understanding this correctly that a "good" practice would be to redirect the user always to e.g. a static "you've granted app X permissions", or other dummy page (within our domains control) which the user will simply close, or oob?

Not asking you to dish out your expertise, just a quick question :) And thanks for the nice articles, you're doing a lot of good.

Re:Achilles Heel of OAuth or Why Facebook Adds #_=_ by homakov on Friday March 15, 2013 @07:18AM (#5379982)
1.a does not implement Implicit flow (sending token #token=..)

sending #_=_ is only protection of facebook open redirect, it's impossible to do same on every possible open redirector on the client's website.

by static I mean exact value of path+query