pagedown
Sun 29 April 2007, 08:27 pm GMT +0300
Hi Olaf,
You fixed a problem which someone reported as a possible SQL injection attack. i.e. an attacker could enter "administrator' or 'a'='a" for the username and get in without a password.
It looks like there is a similar although more difficult to exploit problem in session_handler.php function _read and others
function _read($ses_id) {
$session_sql = "SELECT * FROM " . $this->ses_table
. " WHERE ses_id = '$ses_id'";
$ses_id is used without being checked. I believe $ses_id is the session id provided from the users browser. A hacker could set this to any value, causing undesirable effects e.g. DROP sessions
I think the code should be
function _read($ses_id) {
$ses_id = mysql_real_escape_string($ses_id);
$session_sql = "SELECT * FROM " . $this->ses_table
. " WHERE ses_id = '$ses_id'";
This also applies to other functions in session_handler.php
Mike
You fixed a problem which someone reported as a possible SQL injection attack. i.e. an attacker could enter "administrator' or 'a'='a" for the username and get in without a password.
It looks like there is a similar although more difficult to exploit problem in session_handler.php function _read and others
function _read($ses_id) {
$session_sql = "SELECT * FROM " . $this->ses_table
. " WHERE ses_id = '$ses_id'";
$ses_id is used without being checked. I believe $ses_id is the session id provided from the users browser. A hacker could set this to any value, causing undesirable effects e.g. DROP sessions
I think the code should be
function _read($ses_id) {
$ses_id = mysql_real_escape_string($ses_id);
$session_sql = "SELECT * FROM " . $this->ses_table
. " WHERE ses_id = '$ses_id'";
This also applies to other functions in session_handler.php
Mike
