> People that can run queries on your MySQL as a user that has FILE privileges, either by legit access or via an SQL-injection vulnerability, can execute commands that might root your server.
This may seem nitpicky, but it makes a world of difference. For instance, none of the (many) shared hosting providers (godaddy et. al.) nor solutions (plesk, cpanel, etc.) I know of give FILE permissions to SQL users at all.
In fact, the shoddy way to create users is through the "GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'%'" command, which does not grant FILE privileges to that user.
Taking this into account, another possible summary is:
If you explicitly created mysql users with the FILE privilege or you are using the root user for day-to-day operations, you may get your server rooted. Stop doing that. Otherwise nothing to see for you here, just move on and install whatever security updates are issued by your distro-de-jour.
Not at all. I was trying to figure out what it was about in a rush (I was leaving home, but RCE on MySQL was high prio for me) and while figuring it out, thought I might write it down for others. It's a lot of info left and right throughout the article, so I might not have put it together correctly. Thanks for the correction!
If you can overwrite any file the MySQL user can write, does that means you can place a malicious library on the system, or must it be loaded from somewhere in the ld search path?
Causing it to try and load a random .so would probably crash the DB. Since this is in the config file, it would restart and immediately crash.
This would be an effective Denial of Service attack.
As for 3) I guess this just something to check for if you find SQL injection vulnerabilities in your application.
Vendor response:
> No official patches or mitigations are available at this time from [Oracle].
> The vulnerabilities were patched by PerconaDB and MariaDB vendors by the end of 30th of August.
Looking at the PoC, it seems possible to overwrite any file that the MySQL user (or whichever user MySQL runs as) can write to.
In the PoC, they overwrite /etc/my.cnf, which is often advised to be chown'ed to mysql, making this possible (normally files in /etc are only root-writable). The new version loads a malicious shared library. This means that you should have made the mistake of making it mysql-writable (on top of others having SQL access to the server in the first place). This is not the case on my Ubuntu 14.04 LTS server, so anyone running that without weird modifications is probably safe as well.
Some wrapper script is mentioned which runs as root (while mysql itself runs as a separate user), which would apparently make it possible to get root on the server. I guess that's another requirement for real impact, but the first 2 compromise your MySQL server already so that's serious enough.
Edit: Updated post according to comment from jstanley. Thanks!