Store hash of session key

Summary:
This prevents security by obscurity.
If I have read-only access to the database then I can pretend to be any logged-in user.

I've used `PhabricatorHash::digest()` (even though we don't need salt as the hashed string is random) to be compatible with user log.

Test Plan:
Applied patch.
Verified I'm still logged in.
Logged out.
Logged in.

  $ arc tasks

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D6080
This commit is contained in:
Jakub Vrana
2013-05-30 17:30:06 -07:00
parent 4295de508f
commit 32f91557f8
5 changed files with 32 additions and 6 deletions

View File

@@ -52,7 +52,7 @@ abstract class PhabricatorController extends AphrontController {
$user->getTableName(),
'phabricator_session',
'web-',
$phsid);
PhabricatorHash::digest($phsid));
if ($info) {
$user->loadFromArray($info);
}