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
F18840212: D8318.id.diff
Mon, Oct 27, 10:30 PM
F18834802: D8318.diff
Sun, Oct 26, 10:53 AM
F18829770: D8318.diff
Sat, Oct 25, 12:56 AM
F18764807: D8318.id19771.diff
Oct 7 2025, 7:59 AM
F18751693: D8318.diff
Oct 4 2025, 12:12 PM
F18605902: D8318.id.diff
Sep 13 2025, 9:36 PM
F18592010: D8318.diff
Sep 12 2025, 11:01 AM
F18379986: D8318.id19783.diff
Aug 28 2025, 4:59 PM
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.