Homec4science

Use better secrets in generating account tokens

Authored by epriestley <git@epriestley.com> on Apr 10 2014, 20:45.

Description

Use better secrets in generating account tokens

Summary:
When we generate account tokens for CSRF keys and email verification, one of the inputs we use is the user's password hash. Users won't always have a password hash, so this is a weak input to key generation. This also couples CSRF weirdly with auth concerns.

Instead, give users a dedicated secret for use in token generation which is used only for this purpose.

Test Plan:

  • Ran upgrade scripts.
  • Verified all users got new secrets.
  • Created a new user.
  • Verified they got a secret.
  • Submitted CSRF'd forms, they worked.
  • Adjusted the CSRF token and submitted CSRF'd forms, verified they don't work.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D8748

Details

Committed
epriestley <git@epriestley.com>Apr 10 2014, 20:45
Pushed
aubortJan 31 2017, 17:16
Parents
rPH3018a5eb0912: Better mobile display of ObjectItemView
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHab7d89edc8ad: Use better secrets in generating account tokens (authored by epriestley <git@epriestley.com>).Apr 10 2014, 20:45