Re:MySQL Remote Root Code Execution/Privilege Escalation Exp...
by JdeBP on Wednesday September 14, 2016 @01:16AM
(#12494381)
You are missing a subtlety by referring to "its configuration file" in the singular. Part of the problem is that there are multiple possible configuration files, at least one set of which normally does not exist and lives in the MySQL data directory which is writable by the unprivileged server user.
Don't grant more permissions to an application than they absolutely need.
Exploiting this remotely requires the ability to change logging, an administrative command which should not be available to anything but your devops tools and your operation engineers. It also requires the write bit to be set on a configuration file; MySQL does not need to be able to write to its configuration file to run. Again, the only thing writing to the file should be your devops tooling.
Follow this simple idea, and you'll avoid a lot of CVEs.
As for the LD_PRELOAD vulnerability, this has been fairly well known for many years (I watched a colleague demonstrate this at a MySQL conference back in 2013), and it affects quite a few more programs than just MySQL.