日期:2014-05-16  浏览次数:20833 次

mysql致命bug-登录漏洞
Security vulnerability in MySQL/MariaDB 在知道用户名的情况下(如root),直接反复重试(平均大约256次)即可登入。

受影响的版本:

All MariaDB and MySQL versions up to 5.1.61, 5.2.11, 5.3.5, 5.5.22 are vulnerable.
MariaDB versions from 5.1.62, 5.2.12, 5.3.6, 5.5.23 are not.
MySQL versions from 5.1.63, 5.5.24, 5.6.6 are not.

============== 补充说明 ==================

这个 Bug 在官方编译的版本中没有发现。如果你是下载的源码,然后自己编译的就有可能遇到这个问题。

这个问题和 memcmp() 这个函数的返回值有关系。目前知道的情况来看,gcc 自带的 memcmp 是安全的,BSD libc 的 memcmp 是安全的。Linux glibc sse 优化过的 memcmp 会有这个问题。

测试脚本
$ for i in `seq 1 1000`; do mysql -u root --password=bad -h 127.0.0.1 2>/dev/null; done
mysql>


来源:http://www.oschina.net/code/snippet_12_11220