Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14357232
D13151.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13151.diff
View Options
diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php
--- a/src/applications/people/storage/PhabricatorUser.php
+++ b/src/applications/people/storage/PhabricatorUser.php
@@ -59,6 +59,7 @@
private $authorities = array();
private $handlePool;
+ private $csrfSalt;
protected function readField($field) {
switch ($field) {
@@ -342,16 +343,14 @@
self::CSRF_TOKEN_LENGTH);
}
- /**
- * @phutil-external-symbol class PhabricatorStartup
- */
public function getCSRFToken() {
- $salt = PhabricatorStartup::getGlobal('csrf.salt');
- if (!$salt) {
- $salt = Filesystem::readRandomCharacters(self::CSRF_SALT_LENGTH);
- PhabricatorStartup::setGlobal('csrf.salt', $salt);
+ if ($this->csrfSalt === null) {
+ $this->csrfSalt = Filesystem::readRandomCharacters(
+ self::CSRF_SALT_LENGTH);
}
+ $salt = $this->csrfSalt;
+
// Generate a token hash to mitigate BREACH attacks against SSL. See
// discussion in T3684.
$token = $this->getRawCSRFToken();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 3:21 AM (18 h, 15 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6911400
Default Alt Text
D13151.diff (1 KB)
Attached To
Mode
D13151: Make CSRF salt per-user instead of per-request
Attached
Detach File
Event Timeline
Log In to Comment