From f10e9c2d64d0304777660a4f70f1e80850ea864b Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Fri, 12 Aug 2022 09:54:35 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B05393=20Security=20hardening?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/loginwebpage.class.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/loginwebpage.class.inc.php b/application/loginwebpage.class.inc.php index 9f0735784..10abc3cf3 100644 --- a/application/loginwebpage.class.inc.php +++ b/application/loginwebpage.class.inc.php @@ -241,7 +241,7 @@ class LoginWebPage extends NiceWebPage } // This token allows the user to change the password without knowing the previous one - $sToken = substr(md5(APPROOT.uniqid()), 0, 16); + $sToken = bin2hex(random_bytes(32)); $oUser->Set('reset_pwd_token', $sToken); CMDBObject::SetTrackInfo('Reset password'); $oUser->AllowWrite(true);