The Most Common OAuth2 Vulnerability(homakov.blogspot.com)
homakov.blogspot.com
The Most Common OAuth2 Vulnerability
http://homakov.blogspot.com/2012/07/saferweb-most-common-oauth2.html
1 comments
it's not hard to fix, agreed.
at the same time it must be fixed in gems, not by developers
By gem developers that is :)
Patching this in my Rails apps was easy; it's a trivial solution, but I'm leaving it here to demonstrate that it's not a hard fix.
When generating the URL to redirect to for authorization:
Then, pass state as a param when generating my OAuth authorization URL.
When the authorizing endpoint returns:
It's worth noting that I did have to update Koala (the Facebook API library we're using) to get arbitrary parameters passed through to #url_for_oauth_code. Older versions had a hardcoded list of parameters, which did not include state.