Bug 1564965 (CVE-2018-2767) - CVE-2018-2767 mysql: use of SSL/TLS not enforced in libmysqld (Return of BACKRONYM)
Summary: CVE-2018-2767 mysql: use of SSL/TLS not enforced in libmysqld (Return of BACK...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2018-2767
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=low,public=20180408,reported=2...
Depends On: 1564966 1564967
Blocks: 1564968
TreeView+ depends on / blocked
 
Reported: 2018-04-09 04:18 UTC by Sam Fowler
Modified: 2019-06-08 22:48 UTC (History)
35 users (show)

Fixed In Version: mysql 5.5.61, mysql 5.6.41, mysql 5.7.23, mariadb 5.5.60, mariadb 10.0.35, mariadb 10.1.33, mariadb 10.2.15, mariadb 10.3.7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-16 15:15:25 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:2439 None None None 2018-08-16 14:16:31 UTC

Description Sam Fowler 2018-04-09 04:18:34 UTC
MySQL 5.5, MariaDB 5.5 and 10.3 have a vulnerability in the client library that does not enforce the use of SSL/TLS. Client applications that specify the use of SSL/TLS can result in established connections without SSL/TLS enabled and no reported error.

This is the result of an incomplete fix for CVE-2015-3152 (a.k.a BACKRONYM).

Reference:

http://www.openwall.com/lists/oss-security/2018/04/08/2

Comment 1 Sam Fowler 2018-04-09 04:18:52 UTC
Created community-mysql tracking bugs for this issue:

Affects: fedora-all [bug 1564967]


Created mariadb tracking bugs for this issue:

Affects: fedora-all [bug 1564966]

Comment 6 Tomas Hoger 2018-07-20 14:53:53 UTC
In reply to comment 0:
> MySQL 5.5, MariaDB 5.5 and 10.3 have a vulnerability in the client library
> that does not enforce the use of SSL/TLS.

Term "client library" is misleading here, as it would normally be used to refer to the libmysqlclient library.  However, this problem affects libmysqld - a library that can be used to embed MySQL server into other applications.  Such application, if only linked against libmysqld, can still open client connections to other MySQL servers using the MySQL client library code in libmysqld.  The problem is that such connections are silently established without TLS/SSL, even though application requested the library to establish TLS/SSL connection.

Note that it's apparently possible to link an application to both libmysqlclient and libmysqld.  In that case, code from one of the libraries will be used, and the application may or may not be affected depending on the linking order.

Comment 7 Tomas Hoger 2018-07-20 14:56:27 UTC
This issue did not affect MySQL and MariaDB packages in Red Hat Software Collections or Red Hat OpenStack Platform, as they do not provide libmysqld (and libmysqlclient).

Comment 8 Tomas Hoger 2018-07-20 20:18:31 UTC
MariaDB addressed this problem in versions 5.5.60, 10.0.35, 10.1.33, 10.2.15, and 10.3.7 via the following commit:

https://github.com/MariaDB/server/commit/f5369faf5bbfb56b5e945836eb3f7c7ee88b4079

The check is documented via the following entry in the release notes:

  The embedded server library now supports SSL when connecting to
  remote servers.

https://mariadb.com/kb/en/library/mariadb-5560-release-notes/
https://mariadb.com/kb/en/library/mariadb-10035-release-notes/
https://mariadb.com/kb/en/library/mariadb-10133-release-notes/
https://mariadb.com/kb/en/library/mariadb-10215-release-notes/
https://mariadb.com/kb/en/library/mariadb-1037-release-notes/

Comment 9 Tomas Hoger 2018-07-20 20:26:29 UTC
Note that even after the above fix TLS/SSL client support in MariaDB's libmysql remains buggy, as there are other code parts that remain inside "#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)" and hence is not compiled in when building libmysqld.  One example is mysql_ssl_set() function:

https://github.com/MariaDB/server/blob/mariadb-5.5.60/sql-common/client.c#L1808-L1819

which is also used to specify CA certificate for server certificate verification.  Hence server certificate can only be verified if it was issued by a CA that is trusted by the system CA certificate store.

Comment 10 Tomas Hoger 2018-07-20 20:32:39 UTC
This problem is not reproducible with MySQL 5.1 as shipped with Red Hat Enterprise Linux 6.  Client connections using both libmysqlclient and libmysqld behave the same.  It may have been introduced in MySQL version 5.5.5 when many "#ifdef HAVE_OPENSSL" to "#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)".

Note that the original BACKRONYM / CVE-2015-3152 issue has no been addressed in MySQL 5.1 in Red Hat Enterprise Linux 6, only in MySQL 5.5 (mysql-55-mysql) packages.

Comment 12 Tomas Hoger 2018-07-20 20:47:04 UTC
This issue is now listed as addressed via Oracle CPU July 2018:

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

It should be addressed in MySQL versions 5.5.61, 5.6.41, and 5.7.23.  However, even though the above advisory was published few days ago, fixed MySQL versions have not been released yet.

Comment 13 Tomas Hoger 2018-07-30 09:02:56 UTC
MySQL upstream fix:

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

This modifies the MySQL client code in libmysqld to fail connection attempt with an error if SSL is requested.

Comment 14 Tomas Hoger 2018-07-31 09:26:19 UTC
Matching release notes entry:

  An unencrypted connection could result from a client connection attempt
  specifying that an encrypted connection was required, if the server was
  not configured to support SSL. (Bug #27759871)

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

It does not explain how the problem was addressed.

Comment 15 errata-xmlrpc 2018-08-16 14:16:20 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2018:2439 https://access.redhat.com/errata/RHSA-2018:2439


Note You need to log in before you can comment on or make changes to this bug.