GHSA-473q-m89c-ghf8: Infoleak
Summary
With SslMode set to VerifyCA or VerifyFull with no configured CA certificate, an unvalidated TLS connection is treated as secure and a clear-text password can be sent before the certificate is checked. This can occur when relying on the password to validate a self-signed cert, e.g., MariaDB's zero-configuration TLS.
Impact
An attacker who can deploy a man-in-the-middle MySQL proxy presenting any self-signed certificate can capture the plaintext database password of a client that:
- uses SslMode = VerifyCA or VerifyFull, and - does not use the SslCa connection string option, and - uses a non-empty password.
The attacker completes the TLS handshake with its own cert, requests a clear-text password authentication scheme (mysqlclearpassword, or forces the cachingsha2password/sha256password clear-text fallback), and receives the password before the fingerprint check rejects the connection, defeating the man-in-the-middle protection VerifyFull is expected to provide.
Not affected: a configured CA (SslCa), CA-validated TLS, local connections (Unix socket / loopback), or empty passwords. Using SslMode set to Preferred or Required is out of scope (this is documented as not authenticating the server).
Workarounds
Provide SslCa with VerifyCA/VerifyFull, use a local/Unix-socket connection, or avoid clear-text authentication.
References
- https://mariadb.org/mission-impossible-zero-configuration-ssl/
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
nuget/MySqlConnectorto a version that resolves this vulnerability.Fixed in 2.6.1 - Configuration
Configure SslCa and use it with SslMode set to VerifyCA or VerifyFull so the server certificate is CA-validated.
MariaDB/MySQL client SslCa = Configured CA certificate - Configuration
Avoid clear-text password authentication schemes, including mysql_clear_password and clear-text fallback for caching_sha2_password or sha256_password.
MariaDB/MySQL client authentication Authentication method = Non-clear-text authentication - Compensating control
Use a local connection through a Unix socket or loopback instead of a remotely interceptable MySQL connection.
Event History
Frequently Asked Questions
Which client configurations are exposed to password capture?
Clients are exposed when they use SslMode=VerifyCA or SslMode=VerifyFull, do not set the SslCa connection-string option, and use a non-empty password. The risk is specifically a network attacker operating a man-in-the-middle MySQL proxy with any self-signed certificate.
What does an attacker need to do to obtain the password?
The attacker must be able to intercept the client’s MySQL connection and complete a TLS handshake using their own self-signed certificate. They then request mysql_clear_password or force the clear-text fallback for caching_sha2_password or sha256_password, receiving the password before certificate fingerprint validation rejects the connection.
Which configurations are identified as not affected?
Connections with a configured CA through SslCa, or otherwise CA-validated TLS, are not affected. Local connections are also listed as not affected.
What mitigation is available if an upgrade cannot be applied immediately?
Configure a CA certificate with the SslCa connection-string option so that TLS is CA-validated. This prevents the described unvalidated connection state that permits the clear-text password to be sent.