瀏覽代碼

Do not clear CSRF token on logout (fix for #1303)

This is a hacky way to allow the use case of #1303.

What happens is

1. User tries to login
2. PreLoginHook kicks in and figures out that the user need to change
their LDAP password or whatever => redirects user
3. While loading the redirect some logic of ours kicks in and logouts
the user (thus clearing the session).
4. We render the new page but now the session and the page disagree
about the CSRF token

This is kind of hacky but I don't think it introduces new attack
vectors.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
tags/v12.0.0beta1
Roeland Jago Douma 7 年之前
父節點
當前提交
bb94b39745
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 4 行新增0 行删除
  1. 4
    0
      lib/private/Session/CryptoSessionData.php

+ 4
- 0
lib/private/Session/CryptoSessionData.php 查看文件

@@ -129,7 +129,11 @@ class CryptoSessionData implements \ArrayAccess, ISession {
* Reset and recreate the session
*/
public function clear() {
$requesttoken = $this->get('requesttoken');
$this->sessionValues = [];
if ($requesttoken !== null) {
$this->set('requesttoken', $requesttoken);
}
$this->isModified = true;
$this->session->clear();
}

Loading…
取消
儲存