Page MenuHomePhabricator

Require a CSRF code for Twitter and JIRA (OAuth 1) logins
ClosedPublic

Authored by epriestley on Feb 23 2014, 11:19 PM.
Tags
None
Referenced Files
F13379844: D8318.diff
Sat, Jun 29, 8:10 AM
F13373158: D8318.id.diff
Fri, Jun 28, 5:14 PM
F13359937: D8318.diff
Tue, Jun 25, 10:36 AM
F13324648: D8318.diff
Sat, Jun 15, 12:51 AM
F13312704: D8318.diff
Tue, Jun 11, 6:57 AM
F13308845: D8318.id19772.diff
Mon, Jun 10, 6:56 AM
F13298431: D8318.diff
Fri, Jun 7, 6:46 AM
F13281824: D8318.diff
Sun, Jun 2, 11:16 AM
Subscribers

Details

Summary

OAuth1 doesn't have anything like the state parameter, and I overlooked that we need to shove one in there somewhere. Append it to the callback URI. This functions like state in OAuth2.

Without this, an attacker can trick a user into logging into Phabricator with an account the attacker controls.

Test Plan
  • Logged in with JIRA.
  • Logged in with Twitter.
  • Logged in with Facebook (an OAuth2 provider).
  • Linked a Twitter account.
  • Linked a Facebook account.
  • Jiggered codes in URIs and verified that I got the exceptions I expected.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

epriestley updated this revision to Unknown Object (????).Feb 23 2014, 11:20 PM
  • Restore the check for an empty 'code' parameter for OAuth2.