[MDEV-6975] Implement TLS protocol Created: 2014-10-29 Updated: 2020-11-02 Resolved: 2014-11-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | SSL |
| Fix Version/s: | 5.5.41, 10.0.15 |
| Type: | Task | Priority: | Major |
| Reporter: | Martin Langhoff | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Support for TLS protocols may well be there, but it is not documented; if present, it has no options to control it. Currently MariaDB claims to support SSLv3. We would like to move away from SSLv3 due to the POODLE vulnerability. In testing, MariaDB client/server currently cannot connect using any of the TLS protocols. Testing was performed on MariaDB 5.5.32-1 on CentOS 6.x x86_64, compiled against OpenSSL. We used the technique of trying ciphers that are not supported in SSLv2 or SSLv3, which leaves the TLS 1.x ciphers - http://www.percona.com/blog/2014/10/15/how-to-close-poodle-sslv3-security-flaw-cve-2014-3566/ . All connections failed with "ERROR 2026 (HY000): SSL connection error: error:00000001:lib(0):func(0):reason(1)". Ideally, MariaDB should have...
thank you! |
| Comments |
| Comment by Martin Langhoff [ 2014-10-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
A simple test is to pick a cipher that is only available for the TLS protocols, and try to use it from the client side:
List Ciphers, filtering out sslv2/3, based on ciphers available in OpenSSL v1.0.1e
Now combine the two:
If you relax the restrictions (i.e.: allow sslv3) the SSLv3 ciphers succeed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Martin Langhoff [ 2014-11-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
What is the resolution on this bug? I cannot spot any related commits in a quick check of the main git repos. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Martin Langhoff [ 2014-11-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Looks like 5.5 is still under bazaar. Found related commits at https://code.launchpad.net/~maria-captains/maria/5.5 - commits 4363 to 4366. Thank you! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2014-11-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The actual bug fix is in revision 4365, file vio/viosslfactories.c. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Martin Langhoff [ 2014-11-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yes, spotted it, thanks! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Tomas Hoger [ 2014-11-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Out of curiosity, how was the initial testing done? I did some Poodle related testing and code inspection with MySQL with rather different results to those noted above. My findings were:
If you want to enable TLS 1.1+ support, you should really add something like:
Also note that you can not disable SSLv3 via OpenSSL cipher list without disabling TLSv1.0 too. There are no TLSv1.0 ciphers that are not SSLv3 ciphers too. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Martin Langhoff [ 2014-11-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have documented a summarized version of my initial testing in the description and first comment on this task. When I filed it I was not certain whether MariaDB was being not very well documented in this regard. I took the statement from the docs that it supported "SSL v3" at face value, did not do protocol analysis on it, nor tried to attack it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Tomas Hoger [ 2014-11-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank yo for the clarification. I managed to parse those one-liners now somehow. As noted above, it's wrong way to test whether MariaDB / MySQL supports SSLv3 or TLSv1. Ciphers that the "openssl ciphers" command lists as SSLv3 are also used by TLS 1.0 and 1.1. The ciphers you are trying to connect with are only in TLS 1.2, so your connection attempt fails when server only supports TLS 1.0. No Poodles here though. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2014-11-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
My intention, in turn, was to enable support for TLSv1.2. It was supposed to be up to the user to select TLSv1.2 ciphers only. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Martin Langhoff [ 2014-11-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Great to hear. At my end, given that MariaDB does not support SSLv3, but only TLSv1, a docs update indicating so would be satisfactory. Unlocking support for newer versions of TLS is of course a good outcome too. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Tomas Hoger [ 2014-11-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If users should be able to disable specific TLS protocol versions, there will need to be a separate configuration option for that (similar to httpd's SSLProtocol or nginx's ssl_protocols). Cipher string in general can not do that. Examples:
There may be a little immediate need now, but it seems to be the way to go long term. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Tomas Hoger [ 2014-11-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
A simple test program that attempts to establish TLS connection with MySQL / MariaDB and prints TLS session information similar to what's printed by openssl s_client. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Tomas Hoger [ 2014-11-20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
For posterity, this commit now disables SSLv2 and SSLv3 as discussed above: http://bazaar.launchpad.net/~maria-captains/maria/5.5/revision/4369 Thank you! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniël van Eeden [ 2015-01-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Related bug for Support for TLSv1.1 and TLSv1.2 in MySQL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Julien Fritsch [ 2020-10-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Micada may I ask why you added the link "This issue is blocked by |