#46437 [Opn]: data leakage because of nonexisting boundary checking in statements for MySQL41
| From: | hostmaster at uuims dot net | Date: | Fri, 31 Oct 2008 17:52:31 +0000 |
| Subject: | #46437 [Opn]: data leakage because of nonexisting boundary checking in statements for MySQL41 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-130367@lists.php.net to get a copy of this message | ||
ID: 46437
User updated by: hostmaster at uuims dot net
Reported By: hostmaster at uuims dot net
Status: Open
Bug Type: MySQL related
Operating System: Fedora Core 4
PHP Version: 5.2.6
New Comment:
My email address is hostmaster at uuism dot net.
Previous Comments:
------------------------------------------------------------------------
[2008-10-31 17:50:58] hostmaster at uuims dot net
Description:
------------
When I run ext/mysqli/tests/bug38710.phpt with PHP 5.2.6 and MySQL
4.1.20, the scripts fails in a manner not anticipated by the test
script.
The $text consists of 8240 a's followed by a string of non-printable
characters (cat -v shows "^@^@^@^Y^@^@^@^M
^@^@M-t^OM-TM-7M-0LM-TM-7M-^@WM^H^@^@^@^@M--M-^F^A^@^Y^@^@^@"), followed
by more a's with the non-printable characters repeated every 8000 a's or
so.
The string $text is not equal to str_repeat('a', 8191) for
mysqli_get_server_version($db)=401020, so the ACTUAL output is:
int(100000)
Done
Thanks.
Jim
Reproduce code:
---------------
<?php
include "connect.inc";
$db = new mysqli($host, $user, $passwd, "test");
$qry=$db->stmt_init();
$qry->prepare("SELECT REPEAT('a',100000)");
$qry->execute();
$qry->bind_result($text);
$qry->fetch();
if ($text !== str_repeat('a', mysqli_get_server_version($db) > 50110?
100000:(mysqli_get_server_version($db)>=50000? 8193:8191))) {
var_dump(strlen($text));
}
echo "Done";
?>
Expected result:
----------------
It should pass since this is expected behavior for MySQL prior to
version 5.1
Actual result:
--------------
It failed
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46437&edit=1