{"id":788,"date":"2021-07-23T12:38:12","date_gmt":"2021-07-23T12:38:12","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/cve-2016-6662-mysql\/"},"modified":"2021-07-23T12:38:12","modified_gmt":"2021-07-23T12:38:12","slug":"cve-2016-6662-mysql","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/cve-2016-6662-mysql\/","title":{"rendered":"CVE-2016-6662 MySQL"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"background-information\">Background Information<\/h2>\n<p>On 12 September, 2016, an independent researcher revealed multiple MySQL\u00ae vulnerabilities. This advisory focuses on a vulnerability with a CVEID of CVE-2016-6662 which can allow attackers to (remotely) inject malicious settings into MySQL configuration files (<code>my.cnf<\/code>) under certain configurations, leading to critical consequences.<\/p>\n<p>More information on MySQL can be found on the following websites:<\/p>\n<ul>\n<li>http:\/\/www.mysql.com\/products\/<\/li>\n<li>http:\/\/www.mysql.com\/why-mysql\/<\/li>\n<li>http:\/\/db-engines.com\/en\/system\/MySQL<\/li>\n<\/ul>\n<p>MySQL derivatives are also affected, including:<\/p>\n<ul>\n<li>MariaDB<\/li>\n<li>PerconaDB<\/li>\n<\/ul>\n<h2 id=\"impact\">Impact<\/h2>\n<p>The vulnerability affects all MySQL servers in the default configuration in all version branches (5.7, 5.6, and 5.5) including the latest versions, and can be exploited by both local and remote attackers. Both the authenticated access to MySQL databases (via network connection or web interfaces such as phpMyAdmin) and SQL Injection could be used as exploitation vectors if a MySQL user has the <code>SUPER<\/code> privilege granted. Additionally, MySQL users with both <code>SELECT<\/code> and <code>FILE<\/code> privileges granted are also affected.<\/p>\n<p>MySQL users created in cPanel are not granted the <code>SUPER<\/code> or <code>FILE<\/code> privileges, however they can be granted these elevated privileges from the <code>root<\/code> MySQL user manually.<\/p>\n<p>A successful exploitation could allow attackers to execute arbitrary code with <code>root<\/code> privileges which would then allow them to fully compromise the server on which an affected version of MySQL or MariaDB is running.<\/p>\n<h2 id=\"how-to-determine-if-your-server-is-affected\">How to determine if your server is affected.<\/h2>\n<h3 id=\"determine-if-you-are-running-mysql-or-mariadb\">Determine if you are running MySQL or MariaDB<\/h3>\n<p>You can determine if MySQL is installed by running the following command as <code>root<\/code>:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">yum list installed | grep MySQL | grep -server\nMySQL56-server.x86_64                             <span style=\"color:#ae81ff\">5<\/span>.6.31-2.cp1156      installed<\/code><\/pre>\n<\/div>\n<p>If the above command does not return any output, verify you are running MariaDB by running the following command as <code>root<\/code>:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">yum list installed | grep MariaDB | grep -server\nMariaDB-server.x86_64                           <span style=\"color:#ae81ff\">10<\/span>.0.27-1.el7.centos   @MariaDB100<\/code><\/pre>\n<\/div>\n<h4 id=\"mysql\">MySQL<\/h4>\n<p>cPanel, L.L.C. is currently working on new versions with updated MySQL RPMs. We will update this section once new versions are available.<\/p>\n<h4 id=\"mariadb\">MariaDB<\/h4>\n<p>MariaDB has fixes in place for versions greater than 10.0.27 and 10.1.17. Run the following command as <code>root<\/code> to check the MariaDB version:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">rpm -q MariaDB-server\nMariaDB-server-10.0.26-1.el7.centos.x86_64<\/code><\/pre>\n<\/div>\n<h2 id=\"resolution\">Resolution<\/h2>\n<h3 id=\"mysql-1\">MySQL<\/h3>\n<p>The following table lists the MySQL versions with updated RPMs and their corresponding cPanel &#038; WHM versions:<\/p>\n<table>\n<thead>\n<tr>\n<th align=\"left\">MySQL version<\/th>\n<th align=\"left\">cPanel &#038; WHM version<\/th>\n<th align=\"left\">Documentation<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\">5.6.32<\/td>\n<td align=\"left\">58.0.30<\/td>\n<td align=\"left\">https:\/\/dev.mysql.com\/doc\/relnotes\/mysql\/5.6\/en\/news-5-6-33.html<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">5.5.52<\/td>\n<td align=\"left\">58.0.30<\/td>\n<td align=\"left\">https:\/\/dev.mysql.com\/doc\/relnotes\/mysql\/5.5\/en\/news-5-5-52.html<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"mariadb-1\">MariaDB<\/h3>\n<p>Versions 10.0.27 and greater are protected for 10.0.x versions of MariaDB, while versions 10.1.17 are protected for 10.1.x versions of MariaDB. If you are running an older version of MariaDB, you can upgrade with the following command:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"color:#75715e\"># yum update MariaDB-server MariaDB-client MariaDB-common MariaDB-devel MariaDB-shared<\/span><\/code><\/pre>\n<\/div>\n<h2 id=\"mitigation\">Mitigation<\/h2>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<ul>\n<li>Manual modifications to the MySQL configuration always carries risk; a qualified systems administrator is recommended.<\/li>\n<li>We <strong>strongly<\/strong> recommend that you backup your databases before performing any of the steps below.<\/li>\n<\/ul><\/div>\n<\/div>\n<p>In most situations, these mitigations are not necessary as unprivileged MySQL users created in cPanel &#038; WHM do not have the <code>SUPER<\/code> or <code>FILE<\/code> grants.<\/p>\n<p>You can check if you have MySQL accounts, other than <code>root<\/code>, with these privileges granted manually by running the following commands as <code>root<\/code>:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">mysql mysql -e <span style=\"color:#e6db74\">'select User,Host from user where User != \"root\" and ( File_priv = \"Y\" or Super_priv = \"Y\" );'<\/span><\/code><\/pre>\n<\/div>\n<p>If waiting for new cPanel versions with updated MySQL RPMs or upgrading to MariaDB is not possible, consider mitigating this issue by running the following commands as <code>root<\/code>:<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">chown root:root \/etc\/my.cnf\nchmod <span style=\"color:#ae81ff\">0644<\/span> \/etc\/my.cnf<\/code><\/pre>\n<\/div>\n<p>This will ensure <code>\/etc\/my.cnf<\/code> is not writable by the MySQL user.<\/p>\n<p>Additionally, you can touch empty root-owned files at <code>\/var\/lib\/mysql\/my.cnf<\/code> and <code>\/var\/lib\/mysql\/.my.cnf<\/code> to prevent MySQL users with <code>SUPER<\/code> or <code>FILE<\/code> privileges from potentially writing to other configuration paths that may be used on certain OS and MySQL version combinations. This may cause warnings to be logged when restarting MySQL.\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">touch \/var\/lib\/mysql\/my.cnf \/var\/lib\/mysql\/.my.cnf<\/code><\/pre>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Background Information On 12 September, 2016, an independent researcher revealed multiple MySQL\u00ae vulnerabilities. This advisory focuses on a vulnerability with a CVEID of CVE-2016-6662 which can allow attackers to (remotely) inject malicious settings into MySQL configuration files (my.cnf) under certain configurations, leading to critical consequences. More information on MySQL can be found on the following &hellip;<\/p>\n","protected":false},"author":1,"featured_media":789,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/788"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=788"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/788\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/789"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}