ietf-corpus

rfc-7627

Transport Layer Security (TLS) Session Hash and Extended Master Secret Extension

K. Bhargavan (Editor), A. Delignat-Lavaud, A. Pironti, A. Langley, M. Ray
date2015-09 streamIETF areasec wgtls statusPROPOSED STANDARD pages15 canonicalhttps://www.rfc-editor.org/rfc/rfc7627 doi10.17487/RFC7627
The Transport Layer Security (TLS) master secret is not cryptographically bound to important session parameters such as the server certificate. Consequently, it is possible for an active attacker to set up two sessions, one with a client and another with a server, such that the master secrets on the two sessions are the same. Thereafter, any mechanism that relies on the master secret for authentication, including session resumption, becomes vulnerable to a man-in-the-middle attack, where the attacker can simply forward messages back and forth between the client and server. This specification defines a TLS extension that contextually binds the master secret to a log of the full handshake that computes it, thus preventing such attacks.

updates

Extracted elements (24)

design-rationale §4

Mixing a hash of the key-exchange messages into master key derivation follows the recommendation that keys should be bound to the security contexts that compute them (NIST SP800-108) and is already used in SSH (RFC 4251). The extended master secret extends this principle to TLS full handshakes.

tls, crypto

design-rationale §6.3

The session hash is defined to include all handshake messages up to and including ClientKeyExchange—but not CertificateVerify—because these messages capture all significant new-session content, and stopping at ClientKeyExchange allows the extended master secret to be computed immediately after the pre-master secret, enabling implementations to shred the temporary pre-master secret from memory as early as possible.

tls, crypto, security

design-rationale §1

The TLS master secret in RFC 5246 is not cryptographically bound to the server certificate or other session parameters, allowing an active attacker (the 'triple handshake' attack) to synchronize two TLS sessions so they share the same master_secret. Any mechanism relying on master secret uniqueness—including session resumption, channel bindings, and renegotiation—is then vulnerable to man-in-the-middle attacks.

tls, security, crypto

interoperability-note §5.4

To interoperate with legacy peers, a TLS endpoint may accept full handshakes using the legacy master secret computation, but it must differentiate such sessions from extended-master-secret sessions by adding a flag to session state. Sessions without the extension are vulnerable to key-synchronization attacks and must not be used for application-level authentication.

tls

normative-requirement §5.2 MUST

A client implementing this document MUST send the extended_master_secret extension in its ClientHello in all handshakes (both full and abbreviated).

tls

normative-requirement §6.4 SHOULD

Clients and servers implementing this document SHOULD refuse SSL 3.0 handshakes. If they choose to support SSL 3.0, the resulting sessions MUST use the legacy master secret computation and the interoperability considerations of Section 5.4 apply.

tls, security

normative-requirement §4 SHOULD NOT

Clients and servers SHOULD NOT accept handshakes that do not use the extended master secret, especially if they rely on features like compound authentication that fall into the vulnerable cases described in Section 6.1.

tls, security

normative-requirement §5.2 SHOULD

If a client receives a ServerHello without the extension, it SHOULD abort the handshake if it does not wish to interoperate with legacy servers. If both sides continue without the extension, they MUST use the standard master secret derivation.

tls

normative-requirement §5.4 MUST NOT

If a full handshake proceeds without the extended master secret extension, the client or server MUST NOT export any key material based on the new master secret for any subsequent application-level authentication. In particular, it MUST disable RFC 5705 keying material export and any EAP relying on compound authentication.

tls, security

normative-requirement §5.2 MUST

If a server implementing this document receives the extended_master_secret extension, it MUST include the extension in its ServerHello message.

tls

normative-requirement §5.4 MUST NOT

If an abbreviated handshake resumes a session that does not use extended_master_secret, the client or server MUST NOT use the current handshake's verify_data for application-level authentication. The client MUST disable renegotiation and any use of the tls-unique channel binding (RFC 5929) on the current connection.

tls, security

normative-requirement §5.1 MUST

If both ClientHello and ServerHello contain the extension and a full handshake takes place, both client and server MUST use the extended master secret derivation algorithm defined in Section 4; all other cryptographic computations remain unchanged.

tls, crypto

normative-requirement §5.3 MUST

If the original session did not use extended_master_secret but the new ServerHello contains the extension, or if the original session used the extension but the new ServerHello does not, the client MUST abort the abbreviated handshake.

tls

normative-requirement §5.2 SHOULD

If the server receives a ClientHello without the extension, it SHOULD abort the handshake if it does not wish to interoperate with legacy clients. If it continues the handshake, it MUST NOT include the extension in the ServerHello.

tls

normative-requirement §5.3 SHOULD NOT

The client SHOULD NOT offer an abbreviated handshake to resume a session that does not use an extended master secret; instead it SHOULD offer a full handshake.

tls

protocol-element §4

The extended master secret replaces the RFC 5246 computation with: master_secret = PRF(pre_master_secret, 'extended master secret', session_hash)[0..47]. This substitutes the 'extended master secret' label for 'master secret' and session_hash for the concatenation of ClientHello.random and ServerHello.random, binding the master secret to all significant session parameters.

tls, crypto

protocol-element §5.1

The 'extended_master_secret' TLS extension has extension type 0x0017 (decimal 23). Its extension_data field is empty, so the full on-wire encoding is 00 17 00 00 (hexadecimal). The extension is applicable to both TLS and DTLS.

tls, crypto

protocol-element §3

The TLS session hash is defined as session_hash = Hash(handshake_messages), where handshake_messages is the concatenation of all Handshake structures from ClientHello through ClientKeyExchange inclusive, including type and length fields. For TLS 1.2, Hash is the function used in Finished computation; for earlier versions, it is the concatenation of MD5 and SHA1.

tls, crypto

registry §7

IANA has assigned extension code point 23 (0x0017) to the 'extended_master_secret' extension in the TLS ExtensionType Values registry, as specified in RFC 5246. This code point was already in use by prototype implementations.

tls, registry

security-consideration §6.4

SSL 3.0 is equally vulnerable to triple handshake attacks and uses obsolete cryptographic constructions. Since the extended master secret countermeasure relies on a TLS extension, it cannot be used with SSL 3.0, which has been deprecated by RFC 7568.

tls, security

security-consideration §6.2 RECOMMENDED

The Hash function used to compute session_hash must be collision resistant because distinct sessions require distinct session hashes. MD5 and SHA1 are NOT RECOMMENDED. TLS 1.2 ciphersuites use SHA-256 or better; earlier versions use the MD5+SHA1 concatenation as in the Finished message computation.

tls, crypto, security

security-consideration §6.3

The session hash covers handshake messages up to and including ClientKeyExchange. New ciphersuites or extensions that add significant session context between ClientKeyExchange and Finished (e.g., session tickets sent by the server) may not be covered, potentially re-opening man-in-the-middle vectors; such applications require careful analysis.

tls, security

security-consideration §6.1

The triple handshake attack requires two preconditions: (1) the client connects to a malicious server (easily achieved in browser contexts), and (2) the pre-master secret is synchronized across two sessions (straightforward with RSA and DHE, also possible with ECDHE when arbitrary explicit curves or small subgroups are allowed, and with SRP/PSK under some conditions). Once master secrets are synchronized, session resumption, TLS exporters, channel bindings, and renegotiation all lose their security guarantees.

tls, security, crypto

wire-format §5.1

The extended_master_secret extension is encoded as four bytes: type 00 17, followed by length 00 00, with no extension_data payload. This is the complete wire representation of the extension in ClientHello and ServerHello.

tls