MariaDB and MySQL Authentication Bypass Exploit
JohnBert writes "A security bug in MariaDB and MySQL has been revealed, allowing a known username and password to access the master user table of a MySQL server and dump it into a locally-stored file. By using a tool like John the Ripper, this file can be easily cracked to reveal text passwords that can provide further access. By committing a threaded brute-force module that abuses the authentication bypass flaw to automatically dump the password database, you can access the database using the cracked password hashes even if the authentication bypass vulnerability is fixed."
"An attacker who knows a correct username (usually the ubiquitous "root") can easily connect using a random password by repeating connection attempts.
"~300 attempts takes only a fraction of second, so basically account password protection is as good as nonexistent," wrote Golubchik."
I guess the db shouldn't answer to any requests outside from known address space.. but still..
world was created 5 seconds before this post as it is.
Basically the password comparison routine uses a bad assumption about memcmp. This assumption fails with a probability of about 1 in 256 on some systems. You just use any random password, try a couple hundred times to log in and eventually it works. Yes, it is that bad.
Most applications that use MySQL that I've seen decided to use imbeded hard coded usernames and passwords (usually for the SA user) so there was no security anyway. The few solutions I've seen that actually used unique usernames and passwords and not SA, usually used an external authentication method so the database didn't have any passwords to expose.
Finding out about this now doesn't scare me all that much. If you had used a good security design and practice, there should be limited exposure of usernames and passwords, but if your design and practice sucks, expect to get hacked and not be able to do anything about it.
"File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
Summary is making it look a LOT worse than it is.
- Bug's already been fixed, only what it did was revealed now.
- Bug does not affect binary distributions from mysql.com, Windows included.
- Bug only affects some distros.
Full description here: https://community.rapid7.com/community/metasploit/blog/2012/06/11/cve-2012-2122-a-tragically-comedic-security-flaw-in-mysql
The author of the article mention a couple of distributions found vulnerable to this bug. In one of them is Arch Linux. But he also said that systems with versions up to 5.1.61, 5.2.11, 5.3.5, 5.5.22 are vulnerable. Then... How the heck can Arch (a rolling release distribution) be affected if they have an updated version of the package already in place, lol. The article is dated June 11, Arch fixed upstream release was committed May 13. So it has been already fixed for nearly 2 months.... wow https://projects.archlinux.org/svntogit/packages.git/log/trunk?h=packages/mysql
Sounds like the bug on the Wii.
There was a bug on the Wii where it used string comparison functions to compare signatures, instead of memory comparison functions. So it terminated at the first null character. So you could fakesign anything easily after 256 tries.
From what little information is on that page, it sounds like the exact same problem.
RHEL and Centos are not affected by this issue:
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2012-2122
http://lists.centos.org/pipermail/centos/2012-June/126719.html
If you're a zombie and you know it, bite your friend!
Sounds like it is only in a small subset of versions. From the source article...
"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.
As far as I know, official vendor MySQL and MariaDB binaries are not vulnerable."
"...even if the authentication bypass vulnerability is fixed."
then you aint fixed the issue have you?
You don't get these issues on BSD running MySQL, either.
Anyone using glibc is begging to be hacked.
Run this on your MySQL box to see if you're vulnerable. Worked for me and was able to gain root access in 2 seconds running MySQL 5.5.22
for i in `seq 1 1000`; do mysql -u root --password=bad -h 127.0.0.1 2>/dev/null; done
... the attacks must have access to the DB first.
If my daemons are firewalled, my MariaDB server only accepts requests from 127.0.0.1 and my authentication code lives out of the httpdocs filesystem (PHP *don't have* to run every script from the httpdocs filesystem!), I don't see how the attacker could try this on my machine without rooting it first.
In this case, the MariaBD passwords are the least of my worries.
Or I'm wrong?
Lisias@Earth.SolarSystem.OrionArm.MilkyWay.Local.Virgo.Universe.org
for i in `seq 1 1000`; do mysql -u root --password=bad -h 127.0.0.1 2>/dev/null; done
To avoid having your db serve live web content without an authentication server in between. It costs more money and most companies staring out use an ISP with a single server with everything but that increases your chances of being hacked exponentially.
http://saveie6.com/
Lookout for that molehill! Yes, some versions are vulnerable, and everyone is having a hissy fit about this. I've tested every single copy of various versions of MySQL that I have running, and they are not vulnerable. And I'm running MySQL on Windows, Arch, RHEL, Ubuntu and CentOS.
My root password is blank!
I only use it for college stuff.