Resolved vulnerability where user could assign himself admin permissions or activation even without email verification

This commit is contained in:
Roman Malosev 2024-03-29 16:06:46 +02:00
parent 474c0fba57
commit bf576d7a67

View file

@ -106,7 +106,7 @@ class Auth
if ($result) {
$request['verify_token'] = $randomToken;
$request['password'] = $this->hash($request['password']);
$db->insert('users', array_keys($request), $request);
$db->insert('users', ['email', 'password', 'username', 'verify_token'], [$request['email'], $request['password'], $request['username'], $request['verify_token']]);
$this->redirect('login');
}