summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2012-08-10 15:27:10 +0200
committerLukas Reschke <lukas@statuscode.ch>2012-08-10 15:28:59 +0200
commit8ec45870a3f1d9dfb633a39b7b8a7c4911533d9e (patch)
tree55eb9dd7ce58b11341a7cb271cd0e2fa2877fb63 /lib
parent0de81f9dad5bfba01f01d468eb0fd1f452354792 (diff)
downloadnextcloud-server-8ec45870a3f1d9dfb633a39b7b8a7c4911533d9e.tar.gz
nextcloud-server-8ec45870a3f1d9dfb633a39b7b8a7c4911533d9e.zip
Validate cookie properly and prevent auth bypass
BIG (!) thanks to Julien CAYSSOL
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php
index 3a65b30ae9f..0730e5ff3a9 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -489,7 +489,7 @@ class OC{
}
// confirm credentials in cookie
if(isset($_COOKIE['oc_token']) && OC_User::userExists($_COOKIE['oc_username']) &&
- OC_Preferences::getValue($_COOKIE['oc_username'], "login", "token") == $_COOKIE['oc_token']) {
+ OC_Preferences::getValue($_COOKIE['oc_username'], "login", "token") === $_COOKIE['oc_token']) {
OC_User::setUserId($_COOKIE['oc_username']);
OC_Util::redirectToDefaultPage();
}