Bug 1301493 (CVE-2016-0546)

Summary: CVE-2016-0546 mysql: unspecified vulnerability in subcomponent: Client (CPU January 2016)
Product: [Other] Security Response Reporter: Martin Prpič <mprpic>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: abaron, aortega, apevec, ayoung, chrisw, dallan, databases-maint, dciabrin, fdinitto, gkotton, gmollett, hhorak, jdornak, jorton, jschluet, jstanek, lhh, lpeer, markmc, mbayer, mmaslano, mmuzila, rbryant, rohara, sclewis, srevivo, tdecacqu
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: mysql 5.5.47, mysql 5.6.28, mysql 5.7.10, mariadb 5.5.47, mariadb 10.1.10, mariadb 10.0.23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-10 04:28:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1301517, 1301518, 1301519, 1304515, 1304516, 1329671, 1329672, 1330444, 1330445, 1342440, 1342454    
Bug Blocks: 1301514    

Description Martin Prpič 2016-01-25 09:10:30 UTC
Vulnerability in the MySQL Server component of Oracle MySQL (subcomponent: Client). Supported versions that are affected are 5.5.46 and earlier, 5.6.27 and earlier and 5.7.9. Easily exploitable vulnerability requiring logon to Operating System. Successful attack of this vulnerability can result in unauthorized Operating System takeover including arbitrary code execution. 

External References:

http://www.oracle.com/technetwork/topics/security/cpujan2016verbose-2367956.html

Comment 1 Martin Prpič 2016-01-25 09:36:30 UTC
Created mariadb tracking bugs for this issue:

Affects: fedora-all [bug 1301518]

Comment 2 Martin Prpič 2016-01-25 09:36:41 UTC
Created community-mysql tracking bugs for this issue:

Affects: fedora-all [bug 1301517]

Comment 3 Martin Prpič 2016-01-25 09:36:53 UTC
Created mariadb-galera tracking bugs for this issue:

Affects: fedora-all [bug 1301519]

Comment 4 Tomas Hoger 2016-02-02 13:54:21 UTC
Looking at the changes applied between upstream versions 5.5.46 and 5.5.47, the only Client-related commit is:

https://github.com/mysql/mysql-server/commit/0dbd5a8797ed4bd18e8b883988fb62177eb0f73f

This change is also described in the 5.5.47 and 5.6.28 release notes:

  Possible buffer overflow from incorrect use of strcpy() and sprintf() was
  corrected. (Bug #21973610)

http://dev.mysql.com/doc/relnotes/mysql/5.5/en/news-5-5-47.html
http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-28.html

There are multiple fixes applied as part of that commit:


* mysql_plugin strcpy() buffer overflow, triggered by excessively long command line argument.  This tool is meant for use by system/database administrator and its arguments are trusted input.  There's no trust boundary bypass.

Affected strcpy() calls use static buffer as the destination, so the overflow is detected by FORTIFY_SOURCE, leading to program abort before any overflow actually happens.

The mysql_plugin tool was introduced in MySQL 5.5, hence older versions (such as MySQL 5.1 in Red Hat Enterprise Linux 6) are not affected by this problem.


* mysqlshow multiple strcpy() buffer overflows.  As with the mysql_plugin above, these are mitigated by FORTIFY_SOURCE to application abort without any code execution impact.  Some are triggered by command line arguments, others may be triggered by long database or table names.  It does not seem databases or tables with long names created in a trusted database server can trigger these overflows, as buffers used were large enough to hold names following the MySQL limit on maximum name length.  A malicious or compromised database server may be able to trigger these.


* mysqlshow multiple strmov()/strxmov() buffer overflows.  strmov() is a strcpy()-like function, and strxmov() is strmov() which accepts multiple source strings.  Exploitation of these overflows is made harder by the use of stack smashing protector, which triggers application abort at the end of the function where overflow happens.

- list_table_status() - arguments to str*mov() come from mysqlshow's command line arguments, therefore no trust boundary is bypassed.

- list_fields() - depending on how mysqlshow is run, arguments to str*mov() can either be command line arguments or table names returned by the server.  As with the strcpy() overflows above, a malicious or compromised database server is required to trigger this flaw.


* conf_to_src and regex/main sprintf() buffer overs.  These are some helper tools apparently used by MySQL developers, but not part of the MySQL packages as shipped with Red Hat products.  Therefore, these issues have no impact.

Comment 5 Tomas Hoger 2016-02-02 13:59:20 UTC
The overflow impact of these issues is very limited, as explained in the comment above.  Upstream rating seems rather incorrect.  There's only any impact if the mysqlshow tool is used to find out information about database or tables on some malicious MySQL server.

Comment 8 errata-xmlrpc 2016-03-31 21:58:48 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2016:0534 https://rhn.redhat.com/errata/RHSA-2016-0534.html

Comment 11 errata-xmlrpc 2016-05-02 12:40:19 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 7

Via RHSA-2016:0705 https://rhn.redhat.com/errata/RHSA-2016-0705.html

Comment 12 errata-xmlrpc 2016-05-26 08:43:08 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS

Via RHSA-2016:1132 https://access.redhat.com/errata/RHSA-2016:1132

Comment 15 errata-xmlrpc 2016-07-25 08:28:39 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7

Via RHSA-2016:1481 https://rhn.redhat.com/errata/RHSA-2016-1481.html

Comment 16 errata-xmlrpc 2016-07-25 08:38:53 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7

Via RHSA-2016:1480 https://rhn.redhat.com/errata/RHSA-2016-1480.html