Explaining the OAuth Session Fixation Attack
hueniverse.com
hueniverse.com
So while they focused on protecting the information assets that OAuth shuffled around, they overlooked using the URLs in the middle as a way to fool the requesting app itself. It's one of those design-level flaws that are difficult to see until you've gotten past full analysis of the other high-risk portions of the OAuth chain.
The other thing that messes with you with OAuth is how closely OAuth resembles a lot of ad-hoc schemes that preceded it; many of them have been tested and analyzed to death, so it lulls you into a false sense of confidence.
Looking at the protocol while thinking to the basic use case (authorizing API access to some consumer app) one tends to think that tricking a user to start the authorization step from outside the consumer could not be easy. But in this flow: http://apiwiki.twitter.com/Sign-in-with-Twitter the case 3 (user logged in to twitter) is really similar to the attack case, except that in attack the request would be to oauth/authorize instead of to oauth/authenticate...
For instance, the Provider could return two tokens with the callback: the original request token (to identify which request the callback is for) and a second "callback" token. To obtain an access token, the consumer would have to provide both the original access token as well as the callback token. Since the callback is issued as a redirect to the user, it wouldn't be possible for an outsider to discover the value of that callback token (I don't think?).
To provide additional security, I would think you could drop the request token from the callback URL altogether, and force the consumer to save the request token in a user session or cookie.
Well, I'm sure it's not as simple as this but I'd be interested in hearing why not, if that's the case.