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.
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