5

If a client presents a higher cipher suite during ClientHello yet eventually negotiates a lower strength cipher suite within the same protocol version, though a higher cipher suite is available on both client and server, who is responsible?

According to How does SSL/TLS work? it is ServerHello which ultimately decides the cipher suite.

From that post:

To remember: the client suggests but the server chooses. The cipher suite is in the hands of the server. Courteous servers are supposed to follow the preferences of the client (if possible), but they can do otherwise and some actually do (e.g. as part of protection against BEAST).

To understand this question better, an example is provided below.

Example With Firefox:

There is a Client (A) and a Server (B).

Client (A) is a Firefox version 65 browser.

Server (B) is a web server serving a site over https.

Behavior:

Connections to Server (B) @ site.server.com are being negotiated from a stronger TLS 1.2 cipher suite to a less strong TLS 1.2 cipher suite, even when a stronger cipher suite is available on both the client and the server. This behavior is confirmed on Firefox 65.

Steps to Reproduce:

  1. Disable TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 and all other weaker cipher suites in Firefox then reload site.server.com The site will load with TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384.

  2. Enable TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 while leaving TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 enabled as well then reload site.server.com.

The weaker cipher suite will be chosen.

In this scenario, who was responsible? ClientHello or ServerHello

10

The client sends only what ciphers it supports in the order of their preference. The server then selects one of these ciphers - which means only the server ultimately decides which cipher gets used.

It is fully up to the server which cipher suite gets selected from the offered ones, i.e. the server might take the client preferences in account but might also completely ignore it. In fact, many servers have a configuration option which allows the server to use either the cipher preferred by the client or the cipher preferred by the server.

  • 3
    @RealDrGordonFreeman: The server chooses to not use some "better" cipher but instead chooses to use some "sufficiently secure" cipher - which is perfectly fine. There is no need to use always the "highest" available crypto but it is perfectly fine to use a sufficiently secure crypto. Using SHA384 instead of "only" SHA256 as in your example does not increase the security in practice but costs more computing power and also takes more bandwidth (HMAC is larger). So why waste resources without practical gain? – Steffen Ullrich Feb 16 at 16:53
  • 9
    @RealDrGordonFreeman: Any service which takes security seriously would make sure that the ciphers used are sufficiently secure and that the rest of the infrastructure is secure too. This behavior would be different from some other services which brag about their military security or "my key size is bigger than yours" but fail to properly address essential security measures outside of the ciphers, like web application security. – Steffen Ullrich Feb 16 at 17:54
  • 3
    @SteffenUllrich is right. If you don't trust a ciphersuite, do not introduce it in your ClientHello. If the server is not pleased with your decision, then you'll get an error and you don't use the service. Simple and fair. – Esa Jokinen Feb 16 at 20:18
  • 2
    @SteffenUllrich SHA-384 (which is just SHA-512 with a different IV and truncated to 384 bits) is likely to take less computing power than SHA-256 on 64-bit systems since it uses 64-bit words instead of 32-bit words. It also has a block size twice as large while not doubling the number of rounds (SHA-256 uses 64 rounds and SHA-512 uses 80). You're probably right that the HMAC would be larger though. – forest Feb 17 at 9:46
  • 2
    @forest: good point with the performance of the hashes. – Steffen Ullrich Feb 17 at 11:21
-1

The server should honor the client's Cipher Suite preference. Citing the TLS 1.2 RFC 5246:

The cipher suite list, passed from the client to the server in the ClientHello message, contains the combinations of cryptographic algorithms supported by the client in order of the client's preference (favorite choice first). ...The server will select a cipher suite or, if no acceptable choices are presented, return a handshake failure alert and close the connection.

So ultimately the server decides. See e.g. Apache httpd mod_ssl directive, which

if enabled, the server's preference will be used.

When in doubt I suggest recording the handshake (pcap) and inspecting the hello messages.

  • 5
    I don't agree that the server should honor the clients preference. What you cite says only that the client tells the server the preference. It then says that the server should select one of the ciphers offered by the client. But nothing there says that the server should honor the clients preference when selecting a cipher. In fact, it is very common that servers prefer their own order. – Steffen Ullrich Feb 16 at 16:33
  • 3
    The server is responsible for choosing, period. The standard says the client can send the list in preferential order, but it doesn’t say anything about the server taking the client’s preferences into account. It only says that it must choose from the client’s presented list. Servers are configured by admins for both performance and security reasons, neither of which the client knows anything about. Only if the admins literally don’t care about their servers should they respect the clients’s preferences. – John Deters Feb 16 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.