Created By
Randall Bennett
09/23/2011 8:02am

Subscribers (219)

BugsFacebook always appends #_=_ to the redirect_uri in the server side authentication flow

  • Status: By Design
  • Priority: None
  • Updated: February 7, 2012 at 2:06pm
Latest response from Facebook
Eric Osgood
This has been marked as 'by design' because it prevents a potential security vulnerability.

Some browsers will append the hash fragment from a URL to the end of a new URL to which they have been redirected (if that new URL does not itself have a hash fragment).

For example if example1.com returns a redirect to example2.com, then a browser going to example1.com#abc will go to example2.com#abc, and the hash fragment content from example1.com would be accessible to a script on example2.com.

Since it is possible to have one auth flow redirect to another, it would be possible to have sensitive auth data from one app accessible to another.

This is mitigated by appending a new hash fragment to the redirect URL to prevent this browser behavior.

If the aesthetics, or client-side behavior, of the resulting URL are of concern, it would be possible to use window.location.hash (or even a server-side redirect of your own) to remove the offending characters.
https://developers.facebook.com/blog/post/552/

That post documents the change. I can't figure out how to avoid having that URL appended, so for now, my app will have to remove the hash on the user side.
90 people can reproduce this issue by following these steps
Repro