cve.bz

CVE-2016-6662

9.8 criticalExploitEPSS 68%Fix available

Critical (9.8). EPSS 68% estimated probability of exploitation activity in the next 30 days.

On this page
Oracle MySQL through 5.5.52, 5.6.x through 5.6.33, and 5.7.x through 5.7.15; MariaDB before 5.5.51, 10.0.x before 10.0.27, and 10.1.x before 10.1.17; and Percona Server before 5.5.51-38.1, 5.6.x before 5.6.32-78.0, and 5.7.x before 5.7.14-7 allow local users to create arbitrary configurations and bypass certain protection mechanisms by setting general_log_file to a my.cnf configuration. NOTE: this can be leveraged to execute arbitrary code with root privileges by setting malloc_lib. NOTE: the affected MySQL version information is from Oracle's October 2016 CPU. Oracle has not commented on third-party claims that the issue was silently patched in MySQL 5.5.52, 5.6.33, and 5.7.15.

Severity

CVSS 3.0

9.8 critical
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
68% (unchanged from 68% a week ago; 68% 30 days ago) estimated probability of exploitation activity in the next 30 days; 99th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-264 Permissions, Privileges, and Access Controls
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2016-6662 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2016-6662?via=ask-ai-copy and https://cve.bz/cve/CVE-2016-6662?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2016-6662 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
oracle:mysqlfrom 5.5.0 through 5.5.52
oracle:mysqlfrom 5.6.0 through 5.6.33
oracle:mysqlfrom 5.7.0 through 5.7.15
percona:percona_serverfrom 5.5 before 5.5.51-38.1
percona:percona_serverfrom 5.6 before 5.6.32-78.0
percona:percona_serverfrom 5.7 before 5.7.14-7
mariadb:mariadbfrom 5.5.20 before 5.5.51
mariadb:mariadbfrom 10.0.0 before 10.0.27
mariadb:mariadbfrom 10.1.0 before 10.1.17
debian:debian_linux8.0
redhat:openstack5.0
redhat:openstack6.0
redhat:openstack7.0
redhat:openstack8
redhat:openstack9
redhat:enterprise_linux7.0
redhat:enterprise_linux_desktop6.0
redhat:enterprise_linux_desktop7.0
redhat:enterprise_linux_server6.0
redhat:enterprise_linux_server_aus7.3
redhat:enterprise_linux_server_aus7.4
redhat:enterprise_linux_server_aus7.6
redhat:enterprise_linux_server_eus7.3
redhat:enterprise_linux_server_eus7.4
redhat:enterprise_linux_server_eus7.5
redhat:enterprise_linux_server_eus7.6
redhat:enterprise_linux_server_tus7.3
redhat:enterprise_linux_server_tus7.6
redhat:enterprise_linux_workstation6.0
redhat:enterprise_linux_workstation7.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian7mysql-5.55.5.52-0+deb7u1DLA-624-1
Debian8mysql-5.55.5.52-0+deb8u1DSA-3666-1
Ubuntu14.04:LTSmariadb-5.55.5.52-1ubuntu0.14.04.1UBUNTU-CVE-2016-6662
Ubuntu14.04:LTSmysql-5.55.5.52-0ubuntu0.14.04.1UBUNTU-CVE-2016-6662 USN-3078-1
Ubuntu14.04:LTSmysql-5.65.6.33-0ubuntu0.14.04.1UBUNTU-CVE-2016-6662
Ubuntu16.04:LTSmariadb-10.010.0.27-0ubuntu0.16.04.1UBUNTU-CVE-2016-6662
Ubuntu16.04:LTSmysql-5.75.7.15-0ubuntu0.16.04.1UBUNTU-CVE-2016-6662 USN-3078-1
Ubuntu16.04:LTSpercona-server-5.6no fix listedUBUNTU-CVE-2016-6662
Ubuntu16.04:LTSpercona-xtradb-cluster-5.65.6.34-26.19-0ubuntu0.16.04.1UBUNTU-CVE-2016-6662
Red Hatenterprise_linux:6::client, enterprise_linux:6::computenode, enterprise_linux:6::server and 1 moremysql, mysql-libs, mysql-test and 6 more0:5.1.73-8.el6_8RHSA-2017:0184
Red Hatenterprise_linux:7::client, enterprise_linux:7::computenode, enterprise_linux:7::server and 1 moremariadb, mariadb-libs, mariadb-test and 6 more1:5.5.52-1.el7RHSA-2016:2595
Red Hatopenstack:5::el6mariadb-galera, mariadb-galera-common, mariadb-galera-server and 1 more0:5.5.42-1.1.el6ostRHSA-2016:2058
Red Hatopenstack:5::el7mariadb-galera, mariadb-galera-common, mariadb-galera-server and 1 more1:5.5.42-1.2.el7ostRHSA-2016:2059
Red Hatopenstack:6::el7mariadb-galera, mariadb-galera-common, mariadb-galera-server and 1 more1:5.5.42-1.2.el7ostRHSA-2016:2060
Red Hatopenstack:7::el7mariadb-galera, mariadb-galera-common, mariadb-galera-server and 1 more1:5.5.42-5.el7ostRHSA-2016:2061
Red Hatopenstack:8::el7mariadb-galera, mariadb-galera-common, mariadb-galera-server and 1 more1:5.5.42-5.el7ostRHSA-2016:2077
Red Hatopenstack:9::el7mariadb-galera, mariadb-galera-common, mariadb-galera-server and 1 more1:5.5.42-5.el7ostRHSA-2016:2062
Red Hatrhel_software_collections:2::el6mariadb55-mariadb, mariadb55-mariadb-libs, mariadb55-mariadb-test and 4 more0:5.5.53-1.el6RHSA-2016:2131
Red Hatrhel_software_collections:2::el6mysql55-mysql, mysql55-mysql-libs, mysql55-mysql-test and 4 more0:5.5.52-1.el6RHSA-2016:2130
Red Hatrhel_software_collections:2::el6rh-mariadb100-mariadb, rh-mariadb100-mariadb-test, rh-mariadb100-mariadb-bench and 7 more1:10.0.28-5.el6RHSA-2016:2927
Red Hatrhel_software_collections:2::el6rh-mariadb101-mariadb, rh-mariadb101-mariadb-test, rh-mariadb101-mariadb-bench and 8 more1:10.1.19-6.el6RHSA-2016:2928
6 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Desktop 12 SP1, Linux Enterprise Server 12 SP1, Linux Enterprise Server for SAP Applications 12 SP1 and 2 moremariadb10.0.27-12.1SUSE-SU-2016:2404-1
SUSELinux Enterprise High Performance Computing 15 SP1-LTSS, Linux Enterprise Server 15 SP1-LTSS, Linux Enterprise Server for SAP Applications 15 SP1mariadb10410.4.30-150100.3.5.10SUSE-RU-2023:3956-1
SUSELinux Enterprise High Performance Computing 15 SP1-LTSS, Linux Enterprise Server 15 SP1-LTSS, Linux Enterprise Server for SAP Applications 15 SP1python-mysqlclient1.4.6-150100.3.3.7SUSE-RU-2023:3956-1
SUSELinux Enterprise Point of Sale 11 SP3, Linux Enterprise Server 11 SP3-LTSS, Linux Enterprise Server 11 SP3-TERADATA and 6 moremysql5.5.52-0.27.1SUSE-SU-2016:2343-1
SUSELinux Enterprise Server 11 SP4, Linux Enterprise Server for SAP Applications 11 SP4, Linux Enterprise Software Development Kit 11 SP4mysql5.5.53-0.30.1SUSE-SU-2016:2780-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5, Linux Enterprise Software Development Kit 12 SP5lz41.8.0-3.5.2SUSE-RU-2023:4991-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5, Linux Enterprise Software Development Kit 12 SP5mariadb-connector-c3.1.22-2.35.1SUSE-RU-2023:4991-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5, Linux Enterprise Software Development Kit 12 SP5mariadb10410.4.30-8.5.46SUSE-RU-2023:4991-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5, Linux Enterprise Software Development Kit 12 SP5python-mysqlclient1.3.14-8.9.2SUSE-RU-2023:4991-1
SUSELinux Enterprise Server 12-LTSS, Linux Enterprise Server for SAP Applications 12mariadb10.0.27-20.13.1SUSE-SU-2016:2395-1
Alpinev3.2mariadb5.5.51-r0ALPINE-CVE-2016-6662
Alpinev3.3mariadb10.1.17-r0ALPINE-CVE-2016-6662

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · Alpine.

Red Hat

Red Hat rates this Important.

Red Hat's statement

All MySQL and MariaDB packages in Red Hat Enterprise Linux and Red Hat Software Collections install the my.cnf configuration file in /etc as root-owned and not writeable to mysqld's mysql user. This default configuration stops the published exploit for this issue.

All MySQL and MariaDB packages for Red Hat Enterprise Linux 7 (either those directly included in Red Hat Enterprise Linux 7 or from Red Hat Software Collections for Red Hat Enterprise Linux 7) run mysqld_safe with mysql user privileges and not root privileges, limiting the potential impact to code execution as mysql system user.

The MySQL 5.1 packages in Red Hat Enterprise Linux 6 do not implement support for library preloading, completely preventing the remote attack vector used by the published exploit.

For additional details, refer to:

https://bugzilla.redhat.com/show_bug.cgi?id=1375198#c12

Red Hat's mitigation

- Ensure all MySQL / MariaDB configuration files are not writeable to the mysql user. This is the default configuration in Red Hat products.

- Ensure that non-administrative database users are not granted FILE privilege. Applications accessing data in MySQL / MariaDB databases, including web application potentially vulnerable to SQL injections, should use database accounts with the lowest privileges required.

- If FILE permission needs to be granted to some non-administrative database users, use secure_file_priv setting to limit where files can be written to or read from.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 6mysql-0:5.1.73-8.el6_8Fixed 2017-01-24RHSA-2017:0184
Red Hat Enterprise Linux 7mariadb-1:5.5.52-1.el7Fixed 2016-11-03RHSA-2016:2595
Red Hat Enterprise Linux OpenStack Platform 5.0 (Icehouse) for RHEL 6mariadb-galera-0:5.5.42-1.1.el6ostFixed 2016-10-13RHSA-2016:2058
Red Hat Enterprise Linux OpenStack Platform 5.0 (Icehouse) for RHEL 7mariadb-galera-1:5.5.42-1.2.el7ostFixed 2016-10-13RHSA-2016:2059
Red Hat Enterprise Linux OpenStack Platform 6.0 (Juno) for RHEL 7mariadb-galera-1:5.5.42-1.2.el7ostFixed 2016-10-13RHSA-2016:2060
Red Hat Enterprise Linux OpenStack Platform 7.0 (Kilo) for RHEL 7mariadb-galera-1:5.5.42-5.el7ostFixed 2016-10-13RHSA-2016:2061
Red Hat OpenStack Platform 8.0 (Liberty)mariadb-galera-1:5.5.42-5.el7ostFixed 2016-10-18RHSA-2016:2077
Red Hat OpenStack Platform 9.0 (Mitaka)mariadb-galera-1:5.5.42-5.el7ostFixed 2016-10-13RHSA-2016:2062
Red Hat Software Collections for Red Hat Enterprise Linux 6mysql55-mysql-0:5.5.52-1.el6Fixed 2016-10-31RHSA-2016:2130
Red Hat Software Collections for Red Hat Enterprise Linux 6mariadb55-mariadb-0:5.5.53-1.el6Fixed 2016-10-31RHSA-2016:2131
Red Hat Software Collections for Red Hat Enterprise Linux 6rh-mysql56-mysql-0:5.6.34-2.el6Fixed 2016-11-15RHSA-2016:2749
Red Hat Software Collections for Red Hat Enterprise Linux 6rh-mariadb100-mariadb-1:10.0.28-5.el6Fixed 2016-12-08RHSA-2016:2927
Red Hat Software Collections for Red Hat Enterprise Linux 6rh-mariadb101-mariadb-1:10.1.19-6.el6Fixed 2016-12-08RHSA-2016:2928
Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUSmysql55-mysql-0:5.5.52-1.el6Fixed 2016-10-31RHSA-2016:2130
Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUSmariadb55-mariadb-0:5.5.53-1.el6Fixed 2016-10-31RHSA-2016:2131
Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUSmysql55-mysql-0:5.5.52-1.el6Fixed 2016-10-31RHSA-2016:2130
Red Hat Enterprise Linux 5mysqlNot affected
Red Hat Enterprise Linux 5mysql55-mysqlWill not fix
Red Hat Mobile Application Platform 4millicoreNot affected
Red Hat OpenStack Platform 10 (Newton)mariadb-galeraNot affected
19 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2016-6662.

Public exploits

Detection rules

Ways to detect this CVE, not exploit code: the nuclei template that checks a system for it, and the Suricata and Snort rules that name it. A rule set may ship a rule turned off, so check yours by its sid.

  • Emerging Threats Open ET EXPLOIT Possible MySQL CVE-2016-6662 Attempt sid 2023201
  • Emerging Threats Open ET EXPLOIT Possible MySQL cnf overwrite CVE-2016-6662 Attempt sid 2023202

References

Check your stackJSON