Repository navigation
fix(mysql): refuse a plain-text password without TLS, and require TLS first on Preferred - #3734
Merged
Merged
Conversation
… proxy's token sign-in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mysql_clear_password, or PAM'sdialog) on a session without TLS. Connector/C 3.4.4 answers that request whateverMYSQL_ENABLE_CLEARTEXT_PLUGINsays, so a session that may run without TLS setsMARIADB_OPT_RESTRICTED_AUTHto every other method (MySQLPlaintextPassword, TableProMySQLCore). The refusal (errno 5010) comes before anything is sent and reads "The server asked for the password in plain text … Set SSL Mode to Required".caching_sha2_password's full authentication with the typed password on a Preferred session to a server without TLS; that is gone with the fallback running with TLS off.tunnelSecuresTransportfield is cleared first.proc_pidinfo), so no program that answers on the port first gets the sign-in.Test plan
MySQLTLSPolicyTests.plaintextPasswordNeedsTLS(Disabled and Preferred against a server that asks for the password in plain text),preferredKeepsPasswordFromFullSHA2Auth(failed on this branch's first version: the typed password reached the fake server); MacMariaDBTLSModeTests.plaintextPasswordNeedsTLS,preferredKeepsPasswordFromFullSHA2Auth,securedTunnelSendsPlaintextPassword;CloudSQLIAMAuthTests.savedSecuredTransportClaimIsDropped,socketForwardSecuresTransport;CloudSQLProxyManagerTests.occupiedPortIsRefused,listenerTheProxyDoesNotOwnIsRefused.preferredFallsBack(both apps) now sees two connections, the TLS attempt ending before the sign-in;MySQLTLSPolicyTests.preferredSendsPlaintextPasswordOverTLSsigns in on the first, encrypted attempt.MySQLTLSPolicyTests11 of 11; MacMariaDBTLSModeTests,CloudSQLIAMAuthTests,CloudSQLProxyManagerTests38 of 38; TableProMySQLCoreTests 129 of 129;lint,l10n(both catalogs, add-only): pass.apple/scripts/probes/check-mariadb-tls-modes.shagainst the shipped Connector/C 3.4.4, both apps' headers: 17 of 17, with Disabled (Preferred's fallback) refusing the plain-text request with 5010 and no secret on the wire.MARIADB_OPT_RESTRICTED_AUTHwithoutmysql_clear_passwordrefuses before the password, on TLS and off it; a native-password sign-in is untouched.