Skip to content

Commit f502502

Browse files
committed
session id must begin with char
1 parent 858d338 commit f502502

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

interface/lib/classes/remoting.inc.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ public function login($username, $password, $client_login = false)
138138
}
139139

140140
//* Create a remote user session
141-
//srand ((double)microtime()*1000000);
142-
$remote_session = bin2hex(random_bytes(20));
141+
// session id must begin with a char, not digit, to avoid mysql type confusion abuse
142+
$remote_session = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz'),0,1).bin2hex(random_bytes(20));
143143
$remote_userid = $user['userid'];
144144
$remote_functions = '';
145145
$tstamp = time() + $this->session_timeout;
@@ -210,8 +210,8 @@ public function login($username, $password, $client_login = false)
210210
return false;
211211
}
212212
//* Create a remote user session
213-
//srand ((double)microtime()*1000000);
214-
$remote_session = bin2hex(random_bytes(20));
213+
// session id must begin with a char, not digit, to avoid mysql type confusion abuse
214+
$remote_session = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz'),0,1).bin2hex(random_bytes(20));
215215
$remote_userid = $remote_user['remote_userid'];
216216
$remote_functions = $remote_user['remote_functions'];
217217
$tstamp = time() + $this->session_timeout;

0 commit comments

Comments
 (0)