Achilles Heel of OAuth or Why Facebook Adds #_=_
homakov.blogspot.com
homakov.blogspot.com
Oddly, Facebook has chosen not to follow this recommendation. So any websites that integrate Facebook OAuth must ensure that they contain no open-redirects or they can be hacked in this way. This is worrisome because open-redirects would not otherwise be considered much of a security problem.
yeah, indeed. It becomes a problem for OAuth only. And, wait, Facebook is pwned, so it's he who MUST worry, not clients
Spec is very long and has many interesting discussions but have a look at real world. neither facebook nor twitter whitelist redirect_uri
Changing the implementation at this point is a daunting task (for both Facebook and our developers) but we do hope to offer it as part of a future migration.
And, I read the OAUth2 spec again http://tools.ietf.org/pdf/draft-ietf-oauth-v2-26.pdf
* Why is there an access_token in a browser url ? (query string or fragment)
The access_token is provided by the Authorization Server to the client, and not to the user.
The user should only received an authorization_code. And, to get an access_token, the client must have an authorization_code and know the "client_secret".
access_token should never been seen on a browser, right ?
Does Facebook really respect the protocol? in other word, is it a facebook problem or an OAuth problem ?
it's also flexible. Even if app 99.99% of time uses response_type=code someday hacker comes and usues token on hacked redirect_uri.
simply speaking response_type is also should be static and constant. But, gosh, let's fix first-world-problem first
Thanks!
also facebook is 90% of oauth
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.
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
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.
hash is supposed to be more secure - not sent on server side.
but with 302 redirects it's not so secure.
If there were a mitm they could get it even if it's in the hash. It has to travel to the client at some point.
of course it's visible in server-2-server, but not client-server
I don't know if any of this is covered by the OAuth spec. (I'm only familiar with the so-called "three-legged" OAuth protocol.)
[1] https://developers.facebook.com/docs/howtos/login/client-sid...
but spec says explicitely to avoid Implicit flow
if you have creds you can obtain access token for ANY redirect_uri, even for leaking. if it would be static it would not be possible to leak it at all
What alternatives are their?