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
F19718916: D8318.id.diff
Thu, Feb 12, 4:35 PM
F19690947: D8318.id19771.diff
Tue, Feb 10, 12:39 AM
F19667440: D8318.id19771.diff
Sat, Feb 7, 5:16 PM
F19585997: D8318.id.diff
Mon, Feb 2, 5:00 AM
F19533411: D8318.id19771.diff
Jan 20 2026, 5:26 PM
F19467937: D8318.diff
Jan 3 2026, 8:04 PM
F19064460: D8318.id.diff
Nov 29 2025, 9:50 PM
F19054107: D8318.diff
Nov 28 2025, 10:40 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.