-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Description
When using SslStream.AuthenticateAsClient with a client certificate, IsMutuallyAuthenticated is set to true even if the server did not request a client certificate and the client didn't send one. It should be false, as the client has not authenticated itself to the server (which is the behaviour on Windows).
I've written a short demo program: smbz/IsMutuallyAuthenticatedDemo. Just so it's here, the core is:
string host = "www.microsoft.com";
TcpClient client = new TcpClient(host, 443);
SslStream stream = new SslStream(client.GetStream());
stream.AuthenticateAsClient(host, clientCertificateCollection, SslProtocols.None, true);
After the call to AuthenticateAsClient, stream.IsMutuallyAuthenticated
is false on Windows but true on Linux.
Configuration
This affects Linux but not Windows (I'm not sure about Mac).
Platform details:
- .NET Core 3.1.302
- OpenSSL 1.1.1d
- Debian 10
Other information
A Wireshark dump verifies that the server doesn't request a client certificate. I can provide the dump file if needed, but I won't make it public because of MAC addresses.
This is not a security vulnerability because it does not affect the authentication of the client to the server or the server to the client. It only makes the client think that it has authenticated itself to the server.