REDHAT-BUG-1414133: Medium severity MySQL mysql vulnerability
MySQL versions 5.5.52, 5.6.33, and 5.7.15 corrected a flaw in the way error log file was handled by mysqldsafe script. The issue allows mysql system user to escalate their privileges to root, and got two CVE ids assigned - CVE-2016-6664 and CVE-2016-5617 - see bug 1386564.
The original fix was applied as part of the patch for another issue - CVE-2016-6662:
https://github.com/mysql/mysql-server/commit/684a165f28b3718160a3e4c5ebd18a465d85e97c
The fix attempted to prevent script from using touch/chown/chmod on the configured log file if it was a symbolic link. This fix was found to be incomplete and having the following issues:
- Fix was racy, and the race was quite easy to win. Changing ownership and mode of arbitrary files was still possible.
- After the fix, mysqldsafe no longer tried to change ownership or mode of the log file if it was symlink, but it still used the file for logging and written new log entries to it. This allowed arbitrary file corruption, at least.
- It was possible to set log-error to point to arbitrary file, bypassing symlinks checks added by the fix.
These additional problems were corrected in versions 5.5.54, 5.6.35, and 5.7.17:
Unsafe use of rm and chown in mysqldsafe could result in privilege escalation. chown now can be used only when the target directory is /var/log. An incompatible change is that if the directory for the Unix socket file is missing, it is no longer created; instead, an error occurs. Due to these changes, /bin/bash is required to run mysqldsafe on Solaris. /bin/sh is still used on other Unix/Linux platforms.
http://dev.mysql.com/doc/relnotes/mysql/5.5/en/news-5-5-54.html http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-35.html http://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-17.html
via the following commit:
https://github.com/mysql/mysql-server/commit/1f93f4381b60e3a8012ba36a4dec920416073759
This fix, however, effectively disables mysqldsafe's logging to file if the script is running as root.
Affected Software
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-1414133?
The severity of REDHAT-BUG-1414133 is critical due to the potential for privilege escalation.
How do I fix REDHAT-BUG-1414133?
To fix REDHAT-BUG-1414133, you should update MySQL to versions 5.5.53, 5.6.34, or 5.7.16 or later.
Which versions of MySQL are affected by REDHAT-BUG-1414133?
MySQL versions 5.5.52, 5.6.33, and 5.7.15 are affected by REDHAT-BUG-1414133.
What type of vulnerability is REDHAT-BUG-1414133?
REDHAT-BUG-1414133 is a privilege escalation vulnerability in the mysqld_safe script.
What are the CVE identifiers associated with REDHAT-BUG-1414133?
REDHAT-BUG-1414133 is associated with CVE-2016-6664 and CVE-2016-5617.