Bug 1602369 (CVE-2018-3070)

Summary: CVE-2018-3070 mysql: Client mysqldump unspecified vulnerability (CPU Jul 2018)
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: apevec, chrisw, databases-maint, dciabrin, hhorak, jjoyce, jorton, jschluet, jstanek, kbasil, lhh, lpeer, markmc, mbayer, mburns, mkocka, mmuzila, mschorm, praiskup, rbryant, sclewis, slinaber, srevivo, tdecacqu
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: mysql 5.5.61, mysql 5.6.41, mysql 5.7.23 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-22 09:58:31 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: 1602383, 1602384, 1602387, 1602388, 1602389, 1602390, 1602391, 1610990, 1643060    
Bug Blocks: 1602385    

Description Andrej Nemec 2018-07-18 09:23:00 UTC
Vulnerability in the MySQL Server component of Oracle MySQL (subcomponent: Client mysqldump). Supported versions that are affected are 5.5.60 and prior, 5.6.40 and prior and  5.7.22 and prior. Easily exploitable vulnerability allows low privileged attacker with network access via multiple protocols to compromise MySQL Server. Successful attacks of this vulnerability can result in unauthorized ability to cause a hang or frequently repeatable crash (complete DOS) of MySQL Server.

External References:

http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html

Comment 1 Andrej Nemec 2018-07-18 09:29:04 UTC
Created community-mysql tracking bugs for this issue:

Affects: fedora-all [bug 1602383]


Created mariadb tracking bugs for this issue:

Affects: fedora-27 [bug 1602392]

Comment 3 Andrej Nemec 2018-07-18 11:05:18 UTC
Created mariadb tracking bugs for this issue:

Affects: fedora-all [bug 1602428]

Comment 6 Joshua Padman 2018-07-25 11:05:01 UTC
mysqldump is not included in mariadb-galera in OpenStack 7, 8, 0, 10 & 12.
It is included in mariadb in OpenStack 13.

Comment 7 Tomas Hoger 2018-08-01 19:42:38 UTC
Looking at the release notes for and changes included in the relevant MySQL versions, this CVE is apparently for this change:

  mysqldump exited abnormally for large --where option values.
  (Bug #26171967, Bug #86496, Bug #27510150)

https://dev.mysql.com/doc/relnotes/mysql/5.5/en/news-5-5-61.html
https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-41.html
https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-23.html

Relevant upstream commit is:

https://github.com/mysql/mysql-server/commit/d982e717aba67227ec40761a21a4211db91aa0e2

This fixes a buffer overflow in the fix_identifier_with_newline() function that is used to escape newline characters found in names of identifier placed into comments of the mysqldump output.

This can be triggered by a log database name or a long value for the --where option.  In both cases, these are specified as command line arguments, which reduces impact of this flaw.  Victim would have to pass excessively long strings from an untrusted source to trigger the flaw.

The function is also used to escape identifier names obtained from the database server.  However, this problem should not be triggered when creating dumps from trusted servers even if untrusted users can create database or table names.  The limits on the length of those names (64 characters in most cases) are low enough to not trigger overflow.

Comment 8 Tomas Hoger 2018-08-01 19:51:45 UTC
The affected function fix_identifier_with_newline() was introduced as part of the fix for CVE-2017-3600 / CVE-2016-5483 (see bug 1433010) and therefore the first affected MySQL versions are 5.5.55, 5.6.36, and 5.7.18.  Older versions are not affected by this issue.

Also note that MariaDB was not affected by this flaw, as it did not include the affected function fix_identifier_with_newline().  It used it's own and different fix for CVE-2017-3600.  That fix defines rather similar function fix_for_comment(), which includes protection against buffer overflow.

MariaDB upstream also lists this CVE as not applicable to MariaDB:

https://mariadb.com/kb/en/library/security-vulnerabilities-in-oracle-mysql-that-did-not-exist-in-mariadb/#httpwwworaclecomtechnetworksecurity-advisorycpujul2018-4258247htmljuly-2018

Comment 11 errata-xmlrpc 2018-11-26 12:34:09 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.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-2018:3655 https://access.redhat.com/errata/RHSA-2018:3655