- Home
- RFC 9849
RFC 9849: TLS Encrypted Client Hello
- E. Rescorla,
- K. Oku,
- N. Sullivan,
- C. A. Wood
Abstract
This document describes a mechanism in Transport Layer Security (TLS) for
encrypting a ClientHello message under a server public key.¶
Status of This Memo
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
Although TLS 1.3 [RFC8446] encrypts most of the handshake, including the
server certificate, there are several ways in which an on-path attacker can
learn private information about the connection. The plaintext Server Name
Indication (SNI) extension in ClientHello messages, which leaks the target
domain for a given connection, is perhaps the most sensitive information
left unencrypted in TLS 1.3.¶
This document specifies a new TLS extension called Encrypted Client
Hello (ECH) that allows clients to encrypt their ClientHello to the
TLS server. This protects the SNI and other potentially sensitive
fields, such as the Application
ECH is not in itself sufficient to protect the identity of the server. The target domain may also be visible through other channels, such as plaintext client DNS queries or visible server IP addresses. However, encrypted DNS mechanisms such as DNS over HTTPS [RFC8484], DNS over TLS/DTLS [RFC7858] [RFC8094], and DNS over QUIC [RFC9250] provide mechanisms for clients to conceal DNS lookups from network inspection, and many TLS servers host multiple domains on the same IP address. Private origins may also be deployed behind a common provider, such as a reverse proxy. In such environments, the SNI remains the primary explicit signal available to observers to determine the server's identity.¶
ECH is supported in TLS 1.3 [RFC8446], DTLS 1.3 [RFC9147], and newer versions of the TLS and DTLS protocols.¶
2. Conventions and Definitions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. All TLS notation comes from [RFC8446], Section 3.¶
3. Overview
This protocol is designed to operate in one of two topologies illustrated below, which we call "Shared Mode" and "Split Mode". These modes are described in the following section.¶
3.1. Topologies
In shared mode, the provider is the origin server for all the domains whose DNS records point to it. In this mode, the TLS connection is terminated by the provider.¶
+--------------------+ +---------------------+
| | | |
| 2001:DB8::1111 | | 2001:DB8::EEEE |
Client <----------------------------->| |
| public.example.com | | private.example.org |
| | | |
+--------------------+ +---------------------+
Client-Facing Server Backend Server
In split mode, the provider is not the origin server for private domains. Rather, the DNS records for private domains point to the provider, and the provider's server relays the connection back to the origin server, who terminates the TLS connection with the client. Importantly, the service provider does not have access to the plaintext of the connection beyond the unencrypted portions of the handshake.¶
In the remainder of this document, we will refer to the ECH-service provider as the "client-facing server" and to the TLS terminator as the "backend server". These are the same entity in shared mode, but in split mode, the client-facing and backend servers are physically separated.¶
See Section 10 for more discussion about the ECH threat model and how it relates to the client, client-facing server, and backend server.¶
3.2. Encrypted ClientHello (ECH)
A client-facing server enables ECH by publishing an ECH configuration, which is an encryption public key and associated metadata. Domains which wish to use ECH must publish this configuration, using the key associated with the client-facing server. This document defines the ECH configuration's format, but delegates DNS publication details to [RFC9460]. See [RFC9848] for specifics about how ECH configurations are advertised in SVCB and HTTPS records. Other delivery mechanisms are also possible. For example, the client may have the ECH configuration preconfigured.¶
When a client wants to establish a TLS session with some backend server, it
constructs a private ClientHello, referred to as the Client.
The client then constructs a public ClientHello, referred to as the
Client. The Client contains innocuous values for
sensitive extensions and an "encrypted_Client.
Finally, the client sends Client to the server.¶
The server takes one of the following actions:¶
-
If it does not support ECH or cannot decrypt the extension, it completes the handshake with
Client. This is referred to as rejecting ECH.¶Hello Outer -
If it successfully decrypts the extension, it forwards the
Clientto the backend server, which completes the handshake. This is referred to as accepting ECH.¶Hello Inner
Upon receiving the server's response, the client determines whether or not ECH was accepted (Section 6.1.4) and proceeds with the handshake accordingly. When ECH is rejected, the resulting connection is not usable by the client for application data. Instead, ECH rejection allows the client to retry with up-to-date configuration (Section 6.1.6).¶
The primary goal of ECH is to ensure that connections to servers in the same
anonymity set are indistinguishab
4. Encrypted ClientHello Configuration
ECH uses Hybrid Public Key Encryption (HPKE) for public key encryption [HPKE].
The ECH configuration is defined by the following ECHConfig structure.¶
opaque HpkePublicKey<1..2^16-1>;
uint16 HpkeKemId; // Defined in RFC 9180
uint16 HpkeKdfId; // Defined in RFC 9180
uint16 HpkeAeadId; // Defined in RFC 9180
uint16 ECHConfigExtensionType; // Defined in Section 11.3
struct {
HpkeKdfId kdf_id;
HpkeAeadId aead_id;
} HpkeSymmetricCipherSuite;
struct {
uint8 config_id;
HpkeKemId kem_id;
HpkePublicKey public_key;
HpkeSymmetricCipherSuite cipher_suites<4..2^16-4>;
} HpkeKeyConfig;
struct {
ECHConfigExtensionType type;
opaque data<0..2^16-1>;
} ECHConfigExtension;
struct {
HpkeKeyConfig key_config;
uint8 maximum_name_length;
opaque public_name<1..255>;
ECHConfigExtension extensions<0..2^16-1>;
} ECHConfigContents;
struct {
uint16 version;
uint16 length;
select (ECHConfig.version) {
case 0xfe0d: ECHConfigContents contents;
}
} ECHConfig;
The structure contains the following fields:¶
- version:
-
The version of ECH for which this configuration is used. The version is the same as the code point for the "encrypted_
client_ hello" extension. Clients MUST ignore any ECHConfigstructure with a version they do not support.¶ - length:
-
The length, in bytes, of the next field. This length field allows implementations to skip over the elements in such a list where they cannot parse the specific version of
ECHConfig.¶ - contents:
-
An opaque byte string whose contents depend on the version. For this specification, the contents are an
ECHConfigstructure.¶Contents
The ECHConfig structure contains the following fields:¶
- key_
config : -
A
HpkeKeyConfigstructure carrying the configuration information associated with the HPKE public key (an "ECH key"). Note that this structure contains theconfig_field, which applies to the entireid ECHConfig.¶Contents -
maximum_:name_ length -
The longest name of a backend server, if known. If not known, this value can be set to zero. It is used to compute padding (Section 6.1.3) and does not constrain server name lengths. Names may exceed this length if, e.g., the server uses wildcard names or added new names to the anonymity set.¶
- public_
name : -
The DNS name of the client-facing server, i.e., the entity trusted to update the ECH configuration. This is used to correct misconfigured clients, as described in Section 6.1.6.¶
-
See Section 6.1.7 for how the client interprets and validates the public_
name .¶ - extensions:
-
A list of ECHConfig
Extension values that the client must take into consideration when generating a ClientHellomessage. Each ECHConfigExtension has a 2-octet type and opaque data value, where the data value is encoded with a 2-octet integer representing the length of the data, in network byte order. ECHConfig Extension values are described below (Section 4.2).¶
The HpkeKeyConfig structure contains the following fields:¶
-
config_:id -
A one-byte identifier for the given HPKE key configuration. This is used by clients to indicate the key used for
ClientHelloencryption. Section 4.1 describes how client-facing servers allocate this value.¶ - kem_
id : -
The HPKE Key Encapsulation Mechanism (KEM) identifier corresponding to
public_. Clients MUST ignore anykey ECHConfigstructure with a key using a KEM they do not support.¶ -
public_:key -
The HPKE public key used by the client to encrypt
Client.¶Hello Inner - cipher_
suites : -
The list of HPKE Key Derivation Function (KDF) and Authenticated Encryption with Associated Data (AEAD) identifier pairs clients can use for encrypting
Client. See Section 6.1 for how clients choose from this list.¶Hello Inner
The client-facing server advertises a sequence of ECH configurations to clients, serialized as follows.¶
ECHConfig ECHConfigList<4..2^16-1>;
The ECHConfigList structure contains one or more ECHConfig structures in
decreasing order of preference. This allows a server to support multiple
versions of ECH and multiple sets of ECH parameters.¶
4.1. Configuration Identifiers
A client-facing server has a set of known ECHConfig values with corresponding
private keys. This set SHOULD contain the currently published values, as well as
previous values that may still be in use, since clients may cache DNS records
up to a TTL or longer.¶
Section 7.1 describes a trial decryption process for decrypting the
ClientHello. This can impact performance when the client-facing server maintains
many known ECHConfig values. To avoid this, the client-facing server SHOULD
allocate distinct config_ values for each ECHConfig in its known set. The
RECOMMENDED strategy is via rejection sampling, i.e., to randomly select
config_ repeatedly until it does not match any known ECHConfig.¶
It is not necessary for config_ values across different client-facing
servers to be distinct. A backend server may be hosted behind two different
client-facing servers with colliding config_ values without any performance
impact. Values may also be reused if the previous ECHConfig is no longer in the
known set.¶
4.2. Configuration Extensions
ECH configuration extensions are used to provide room for additional functionality as needed. The format is as defined in Section 4 and mirrors Section 4.2 of [RFC8446]. However, ECH configuration extension types are maintained by IANA as described in Section 11.3. ECH configuration extensions follow the same interpretation rules as TLS extensions: extensions MAY appear in any order, but there MUST NOT be more than one extension of the same type in the extensions block. Unlike TLS extensions, an extension can be tagged as mandatory by using an extension type codepoint with the high order bit set to 1.¶
Clients MUST parse the extension list and check for unsupported mandatory
extensions. If an unsupported mandatory extension is present, clients MUST
ignore the ECHConfig.¶
Any future information or hints that influence Client SHOULD be
specified as ECHConfig extensions. This is primarily because the outer
ClientHello exists only in support of ECH. Namely, it is both an envelope for
the encrypted inner ClientHello and an enabler for authenticated key mismatch
signals (see Section 7). In contrast, the inner ClientHello is the
true ClientHello used upon ECH negotiation.¶
5. The "encrypted_client_hello" Extension
To offer ECH, the client sends an "encrypted_Client. When it does, it MUST also send the extension in
Client.¶
enum {
encrypted_client_hello(0xfe0d), (65535)
} ExtensionType;
The payload of the extension has the following structure:¶
enum { outer(0), inner(1) } ECHClientHelloType;
struct {
ECHClientHelloType type;
select (ECHClientHello.type) {
case outer:
HpkeSymmetricCipherSuite cipher_suite;
uint8 config_id;
opaque enc<0..2^16-1>;
opaque payload<1..2^16-1>;
case inner:
Empty;
};
} ECHClientHello;
The outer extension uses the outer variant and the inner extension uses the
inner variant. The inner extension has an empty payload, which is included
because TLS servers are not allowed to provide extensions in ServerHello
which were not included in ClientHello. The outer extension has the following
fields:¶
-
config_:id -
The
ECHConfigfor the chosenContents .key_ config .config_ id ECHConfig.¶ -
cipher_:suite -
The cipher suite used to encrypt
Client. This MUST match a value provided in the correspondingHello Inner ECHConfiglist.¶Contents .key_ config .cipher_ suites - enc:
-
The HPKE encapsulated key used by servers to decrypt the corresponding
payloadfield. This field is empty in aClientsent in response to HelloHello Outer Retry Request .¶ - payload:
-
The serialized and encrypted
Encodedstructure, encrypted using HPKE as described in Section 6.1.¶Client Hello Inner
When a client offers the outer version of an "encrypted_
struct {
ECHConfigList retry_configs;
} ECHEncryptedExtensions;
The response is valid only when the server used the Client. If the
server sent this extension in response to the inner variant, then the client
MUST abort with an "unsupported_
- retry_
configs : -
An
ECHConfigListstructure containing one or moreECHConfigstructures, in decreasing order of preference, to be used by the client as described in Section 6.1.6. These are known as the server's "retry configurations".¶
Finally, when the client offers the "encrypted_inner variant and the server responds with Hello
struct {
opaque confirmation[8];
} ECHHelloRetryRequest;
The value of ECHHellohrr_ as described in Section 7.2.1.¶
This document also defines the "ech_
5.1. Encoding the ClientHelloInner
Before encrypting, the client pads and optionally compresses Client
into an Encoded structure, defined below:¶
struct {
ClientHello client_hello;
uint8 zeros[length_of_padding];
} EncodedClientHelloInner;
The client_ field is computed by first making a copy of Client
and setting the legacy_ field to the empty string. In TLS, this
field uses the ClientHello structure defined in Section 4.1.2 of [RFC8446].
In DTLS, it uses the ClientHello structure defined in
Section 5.3 of [RFC9147]. This does not include the Handshake structure's
four-byte header in TLS, nor the twelve-byte header in DTLS. The zeros field MUST
be all zeros of length length_ (see Section 6.1.3).¶
Repeating large extensions, such as "key_Client and Client can lead to excessive size. To
reduce the size impact, the client MAY substitute extensions which it knows
will be duplicated in Client. It does so by removing and replacing
extensions from Encoded with a single "ech_
enum {
ech_outer_extensions(0xfd00), (65535)
} ExtensionType;
ExtensionType OuterExtensions<2..254>;
OuterExtensions contains a list of the removed ExtensionType values. Each value references
the matching extension in Client. The values MUST be ordered
contiguously in Client, and the "ech_Encoded.
Additionally, the extensions MUST appear in Client in the same
relative order. However, there is no requirement that they be contiguous. For
example, OuterClient
contains extensions A, D, B, C, E, and F.¶
The "ech_Encoded and MUST NOT appear in either Client or
Client.¶
Finally, the client pads the message by setting the zeros field to a byte
string whose contents are all zeros and whose length is the amount of padding
to add. Section 6.1.3 describes a recommended padding scheme.¶
The client-facing server computes Client by reversing this process.
First, it parses Encoded, interpreting all bytes after
client_ as padding. If any padding byte is non-zero, the server MUST
abort the connection with an "illegal_
Next, it makes a copy of the client_ field and copies the
legacy_ field from Client. It then looks for an
"ech_Client. The server MUST
abort the connection with an "illegal_
-
Any referenced extension is missing in
Client.¶Hello Outer -
Any extension is referenced in Outer
Extensions more than once.¶ -
"encrypted_
client_ hello" is referenced in Outer Extensions .¶ -
The extensions in
Clientcorresponding to those in OuterHello Outer Extensions do not occur in the same order.¶
These requirements prevent an attacker from performing a packet amplification
attack by crafting a Client which decompresses to a much larger
Client. This is discussed further in Section 10.12.4.¶
Receiving implementations SHOULD construct the Client in linear
time. Quadratic time implementations (such as may happen via naive
copying) create a denial
5.2. Authenticating the ClientHelloOuter
To prevent a network attacker from modifying the Client
while keeping the same encrypted Client
(see Section 10.12.3), ECH authenticates Client
by passing Client as the associated data for HPKE sealing
and opening operations. The Client is a serialized
ClientHello structure, defined in Section 4.1.2 of [RFC8446] for TLS and
Section 5.3 of [RFC9147] for DTLS, which matches the Client except
that the payload field of the "encrypted_
6. Client Behavior
Clients that implement the ECH extension behave in one of two ways: either they offer a real ECH extension, as described in Section 6.1, or they send a Generate Random Extensions And Sustain Extensibility (GREASE) [RFC8701] ECH extension, as described in Section 6.2. The client offers ECH if it is in possession of a compatible ECH configuration and sends GREASE ECH (see Section 6.2) otherwise. Clients of the latter type do not negotiate ECH; instead, they generate a dummy ECH extension that is ignored by the server. (See Section 10.10.4 for an explanation.) It is also possible for clients to always send GREASE ECH without implementing the remainder of this specification.¶
6.1. Offering ECH
To offer ECH, the client first chooses a suitable ECHConfig from the server's
ECHConfigList. To determine if a given ECHConfig is suitable, it checks that
it supports the KEM algorithm identified by
ECHConfig, at least one KDF/AEAD algorithm
identified by ECHConfig, and the version of
ECH indicated by ECHConfig. Once a suitable configuration is found,
the client selects the cipher suite it will use for encryption. It MUST NOT
choose a cipher suite or version not advertised by the configuration. If no
compatible configuration is found, then the client SHOULD proceed as described
in Section 6.2.¶
Next, the client constructs the Client message just as it does a
standard ClientHello, with the exception of the following rules:¶
-
It MUST NOT offer to negotiate TLS 1.2 or below. This is necessary to ensure the backend server does not negotiate a TLS version that is incompatible with ECH.¶
-
It MUST NOT offer to resume any session for TLS 1.2 and below.¶
-
If it intends to compress any extensions (see Section 5.1), it MUST order those extensions consecutively.¶
-
It MUST include the "encrypted_
client_ hello" extension of type inneras described in Section 5. (This requirement is not applicable when the "encrypted_client_ hello" extension is generated as described in Section 6.2.)¶
The client then constructs Encoded as described in
Section 5.1. It also computes an HPKE encryption context and enc value
as:¶
pkR = DeserializePublicKey(ECHConfig.contents.key_config.public_key)
enc, context = SetupBaseS(pkR,
"tls ech" || 0x00 || ECHConfig)
Next, it constructs a partial Client as it does a standard
ClientHello, with the exception of the following rules:¶
-
It MUST offer to negotiate TLS 1.3 or above.¶
-
If it compressed any extensions in
Encoded, it MUST copy the corresponding extensions fromClient Hello Inner Client. The copied extensions additionally MUST be in the same relative order as inHello Inner Client.¶Hello Inner -
It MUST copy the legacy_
session_ id field from Client. This allows the server to echo the correct session ID for TLS 1.3's compatibility mode (see Appendix D.4 of [RFC8446]) when ECH is negotiated. Note that compatibility mode is not used in DTLS 1.3, but following this rule will produce the correct results for both TLS 1.3 and DTLS 1.3.¶Hello Inner -
It MAY copy any other field from the
ClientexceptHello Inner Client. Instead, it MUST generate a freshHello Inner .random Clientusing a secure random number generator. (See Section 10.12.1.)¶Hello Outer .random -
It SHOULD place the value of
ECHConfigin the "server_.contents .public_ name name" extension. Clients that do not follow this step, or place a different value in the "server_ name" extension, risk breaking the retry mechanism described in Section 6.1.6 or failing to interoperate with servers that require this step to be done; see Section 7.1.¶ -
When the client offers the "pre_
shared_ key" extension in Client, it SHOULD also include a GREASE "pre_Hello Inner shared_ key" extension in Client, generated in the manner described in Section 6.1.2. The client MUST NOT use this extension to advertise a PSK to the client-facing server. (See Section 10.12.3.) When the client includes a GREASE "pre_Hello Outer shared_ key" extension, it MUST also copy the "psk_ key_ exchange_ modes" from the Clientinto theHello Inner Client.¶Hello Outer -
When the client offers the "early_
data" extension in Client, it MUST also include the "early_Hello Inner data" extension in Client. This allows servers that reject ECH and useHello Outer Clientto safely ignore any early data sent by the client per [RFC8446], Section 4.2.10.¶Hello Outer
The client might duplicate non-sensitive extensions in both messages. However,
implementations need to take care to ensure that sensitive extensions are not
offered in the Client. See Section 10.5 for additional
guidance.¶
Finally, the client encrypts the Encoded with the above values,
as described in Section 6.1.1, to construct a Client. It
sends this to the server and processes the response as described in
Section 6.1.4.¶
6.1.1. Encrypting the ClientHello
Given an Encoded, an HPKE encryption context and enc value,
and a partial Client, the client constructs a Client as
follows.¶
First, the client determines the length L of encrypting Encoded
with the selected HPKE AEAD. This is typically the sum of the plaintext length
and the AEAD tag length. The client then completes the Client with
an "encrypted_ECHClientHello with the following fields:¶
-
config_, the identifier corresponding to the chosenid ECHConfigstructure;¶ -
cipher_, the client's chosen cipher suite;¶suite -
enc, as given above; and¶ -
payload, a placeholder byte string containing L zeros.¶
If configuration identifiers (see Section 10.4) are to be
ignored, config_ SHOULD be set to a randomly generated byte in the
first Client and, in the event of a HelloClient.¶
The client serializes this structure to construct the Client.
It then computes the final payload as:¶
final_payload = context.Seal(ClientHelloOuterAAD,
EncodedClientHelloInner)
Including Client as the HPKE AAD binds the Client
to the Client, thus preventing attackers from modifying
Client while keeping the same Client, as described in
Section 10.12.3.¶
Finally, the client replaces payload with final_ to obtain
Client. The two values have the same length, so it is not necessary
to recompute length prefixes in the serialized structure.¶
Note this construction requires the "encrypted_Client's
"pre_
6.1.2. GREASE PSK
When offering ECH, the client is not permitted to advertise PSK identities in
the Client. However, the client can send a "pre_Client. In this case, when resuming a session with the client,
the backend server sends a "pre_Client,
clients SHOULD send a GREASE "pre_Client to make it appear to the network as if the extension were
negotiated properly.¶
The client generates the extension payload by constructing an OfferedPsks
structure (see [RFC8446], Section 4.2.11) as follows. For each PSK identity
advertised in the Client, the client generates a random PSK identity
with the same length. It also generates a random, 32-bit, unsigned integer to
use as the obfuscated_. Likewise, for each inner PSK binder, the
client generates a random string of the same length.¶
Per the rules of Section 6.1, the server is not permitted to resume a
connection in the outer handshake. If ECH is rejected and the client-facing
server replies with a "pre_
6.1.3. Recommended Padding Scheme
If the Client is encrypted without padding, then the length of
the Client can leak information about Client.
In order to prevent this, the Encoded structure
has a padding field. This section describes a deterministic mechanism for
computing the required amount of padding based on the following
observation: individual extensions can reveal sensitive information through
their length. Thus, each extension in the inner ClientHello may require
different amounts of padding. This padding may be fully determined by the
client's configuration or may require server input.¶
By way of example, clients typically support a small number of application
profiles. For instance, a browser might support HTTP with ALPN values
["http/1.1", "h2"] and WebRTC media with ALPNs ["webrtc", "c-webrtc"]. Clients
SHOULD pad this extension by rounding up to the total size of the longest ALPN
extension across all application profiles. The target padding length of most
ClientHello extensions can be computed in this way.¶
In contrast, clients do not know the longest SNI value in the client-facing
server's anonymity set without server input. Clients SHOULD use the ECHConfig's
maximum_ field as follows, where M is the maximum_
value.¶
-
If the
Clientcontained a "server_Hello Inner name" extension with a name of length D, add max(0, M - D) bytes of padding.¶ -
If the
Clientdid not contain a "server_Hello Inner name" extension (e.g., if the client is connecting to an IP address), add M + 9 bytes of padding. This is the length of a "server_ name" extension with an M-byte name.¶
Finally, the client SHOULD pad the entire message as follows:¶
-
Let L be the length of the
Encodedwith all the padding computed so far.¶Client Hello Inner -
Let N = 31 - ((L - 1) % 32) and add N bytes of padding.¶
This rounds the length of Encoded up to a multiple of 32 bytes,
reducing the set of possible lengths across all clients.¶
In addition to padding Client, clients and servers will also need to
pad all other handshake messages that have sensitiveClient, the server-selected value
will be returned in an Encrypted
6.1.4. Determining ECH Acceptance
As described in Section 7, the server may either accept ECH and use
Client or reject it and use Client. This is determined by
the server's initial message.¶
If the message does not negotiate TLS 1.3 or higher, the server has rejected
ECH. Otherwise, the message will be either a ServerHello or a Hello
If the message is a ServerHello, the client computes accept_ as
described in Section 7.2. If this value matches the last 8 bytes of
Server, the server has accepted ECH. Otherwise, it has rejected
ECH.¶
If the message is a Hellohrr_ as described in Section 7.2.1. If this value
matches the extension payload, the server has accepted ECH. Otherwise, it has
rejected ECH.¶
If the server accepts ECH, the client handshakes with Client as
described in Section 6.1.5. Otherwise, the client handshakes with
Client as described in Section 6.1.6.¶
6.1.5. Handshaking with ClientHelloInner
If the server accepts ECH, the client proceeds with the connection as in [RFC8446], with the following modifications:¶
The client behaves as if it had sent Client as the ClientHello. That
is, it evaluates the handshake using the Client's preferences, and,
when computing the transcript hash (Section 4.4.1 of [RFC8446]), it uses
Client as the first ClientHello.¶
If the server responds with a HelloClientHello message as follows:¶
-
It computes a second
Clientbased on the firstHello Inner Client, as in Section 4.1.4 of [RFC8446]. TheHello Inner Client's "encrypted_Hello Inner client_ hello" extension is left unmodified.¶ -
It constructs
Encodedas described in Section 5.1.¶Client Hello Inner -
It constructs a second partial
Clientmessage. This message MUST be syntactically valid. The extensions MAY be copied from the originalHello Outer AAD Clientunmodified or omitted. If not sensitive, the client MAY copy updated extensions from the secondHello Outer Clientfor compression.¶Hello Inner -
It encrypts
Encodedas described in Section 6.1.1, using the second partialClient Hello Inner Client, to obtain a secondHello Outer AAD Client. It reuses the original HPKE encryption context computed in Section 6.1 and uses the empty string forHello Outer enc.¶The HPKE context maintains a sequence number, so this operation internally uses a fresh nonce for each AEAD operation. Reusing the HPKE context avoids an attack described in Section 10.12.2.¶
The client then sends the second Client to the server. However, as
above, it uses the second Client for preferences, and both the
Client messages for the transcript hash. Additionally, it checks the
resulting ServerHello for ECH acceptance as in Section 6.1.4.
If the ServerHello does not also indicate ECH acceptance, the client MUST
terminate the connection with an "illegal_
6.1.6. Handshaking with ClientHelloOuter
If the server rejects ECH, the client proceeds with the handshake,
authenticating for ECHConfig as described in
Section 6.1.7. If authentication or the handshake fails, the client MUST
return a failure to the calling application. It MUST NOT use the retry
configurations. It MUST NOT treat this as a secure signal to
disable ECH.¶
If the server supplied an "encrypted_
If the server provided "retry_
Because the new ECH configuration replaces the old ECH configuration,
clients can implement a new transport connection in any way that is
consistent with the previous ECH configuration. For example, clients
can reuse the same server IP address when establishing the new
transport connection or they can choose to use a different IP address
if DNS provided other IP addresses for the previous configuration.
However, it is not safe to use IP addresses discovered with a new
DNS query, as those may correspond to a different ECH server
configuration, for instance associated with a different ECH server
with a different public_.¶
The retry configurations are meant to be used for retried connections. Further use of retry configurations could yield a tracking vector. In settings where the client will otherwise already let the server track the client, e.g., because the client will send cookies to the server in parallel connections, using the retry configurations for these parallel connections does not introduce a new tracking vector.¶
If none of the values provided in "retry_
Clients SHOULD NOT accept "retry_
If a client does not retry, it MUST report an error to the calling application.¶
6.1.7. Authenticating for the Public Name
When the server rejects ECH, it continues with the handshake using the plaintext
"server_
-
The client MUST verify that the certificate is valid for
ECHConfig. If invalid, it MUST abort the connection with the appropriate alert.¶.contents .public_ name -
If the server requests a client certificate, the client MUST respond with an empty Certificate message, denoting no client certificate.¶
In verifying the client-facing server certificate, the client MUST
interpret the public name as a DNS-based reference identity
[RFC9525]. Clients that incorporate DNS names and IP addresses into
the same syntax (e.g. Section 7.4 of [RFC3986] and [WHATWG-IPV4])
MUST reject names that would be interpreted as IPv4 addresses.
Clients that enforce this by checking ECHConfig
do not need to repeat the check when processing ECH rejection.¶
Note that authenticating a connection for the public name does not authenticate it for the origin. The TLS implementation MUST NOT report such connections as successful to the application. It additionally MUST ignore all session tickets and session IDs presented by the server. These connections are only used to trigger retries, as described in Section 6.1.6. This may be implemented, for instance, by reporting a failed connection with a dedicated error code.¶
Prior to attempting a connection, a client SHOULD validate the
ECHConfig. Clients SHOULD ignore any
ECHConfig structure with a public_
Clients additionally SHOULD ignore the structure if the final LDH
label either consists of all ASCII digits (i.e., '0' through '9') or is
"0x" or "0X" followed by some, possibly empty, sequence of ASCII
hexadecimal digits (i.e., '0' through '9', 'a' through 'f', and 'A'
through 'F'). This avoids public_
6.1.8. Impact of Retry on Future Connections
Clients MAY use information learned from a rejected ECH for future
connections to avoid repeatedly connecting to the same server and
being forced to retry. However, they MUST handle ECH rejection for
those connections as if it were a fresh connection, rather than
enforcing the single retry limit from Section 6.1.6. The reason
for this requirement is that if the server sends a "retry_
Any persisted information MUST be associated with the ECHConfig source
used to bootstrap the connection, such as a DNS SVCB ServiceMode record
[RFC9848]. Clients MUST limit any sharing of persisted ECH-related
state to connections that use the same ECHConfig source. Otherwise, it
might become possible for the client to have the wrong public name for
the server, making recovery impossible.¶
ECHConfigs learned from ECH rejection can be used as a tracking vector. Clients SHOULD impose the same lifetime and scope restrictions that they apply to other server-based tracking vectors such as PSKs.¶
In general, the safest way for clients to minimize ECH retries is to comply with any freshness rules (e.g., DNS TTLs) imposed by the ECH configuration.¶
6.2. GREASE ECH
The GREASE ECH mechanism allows a connection between an ECH-capable client and a non-ECH server to appear to use ECH, thus reducing the extent to which ECH connections stick out (see Section 10.10.4).¶
6.2.1. Client Greasing
If the client attempts to connect to a server and does not have an ECHConfig
structure available for the server, it SHOULD send a GREASE [RFC8701]
"encrypted_ClientHello as follows:¶
-
Set the
config_field to a random byte.¶id -
Set the
cipher_field to a supported Hpkesuite Symmetric Cipher Suite . The selection SHOULD vary, so that all plausible configurations are exercised, but MAY be held constant for successive connections to the same server in the same session. Note: A "plausible" configuration is one that an observer might expect to see. A client that fully supports ECH will have a set of supported HPKE cipher suites to select from. A client that only supports GREASE ECH has no such list, so it should select from a set of values that are in common usage.¶ -
Set the
encfield to a randomly generated valid encapsulated public key output by the HPKE KEM.¶ -
Set the
payloadfield to a randomly generated string of L+C bytes, where C is the ciphertext expansion of the selected AEAD scheme and L is the size of theEncodedthe client would compute when offering ECH, padded according to Section 6.1.3.¶Client Hello Inner
If sending a second ClientHello in response to a HelloClientHello. The identical value will reveal to an observer that the value of
"encrypted_
If the server sends an "encrypted_
Offering a GREASE extension is not considered offering an encrypted ClientHello
for purposes of requirements in Section 6.1. In particular, the client
MAY offer to resume sessions established without ECH.¶
6.2.2. Server Greasing
Section 11.3 describes a set of Reserved extensions which will never be registered. These can be used by servers to "grease" the contents of the ECH configuration, as inspired by [RFC8701]. This helps ensure clients process ECH extensions correctly. When constructing ECH configurations, servers SHOULD randomly select from reserved values with the high-order bit clear. Correctly implemented clients will ignore those extensions.¶
The reserved values with the high-order bit set are mandatory, as defined in Section 4.2. Servers SHOULD randomly select from these values and include them in extraneous ECH configurations. Correctly implemented clients will ignore these configurations because they do not recognize the mandatory extension. Servers SHOULD ensure that any client using these configurations encounters a warning or error message. This can be accomplished in several ways, including:¶
-
By giving the extraneous configurations distinctive config IDs or public names, and rejecting the TLS connection or inserting an application
-level warning message when these are observed.¶ -
By giving the extraneous configurations an invalid public key and a public name not associated with the server so that the initial
Clientwill not be decryptable and the server cannot perform the recovery flow described in Section 6.1.6.¶Hello Outer
7. Server Behavior
As described in Section 3.1, servers can play two roles, either as
the client-facing server or as the backend server.
Depending on the server role, the ECHClientHello will be different:¶
-
A client-facing server expects an
ECHClientofHello .type outer, and proceeds as described in Section 7.1 to extract aClient, if available.¶Hello Inner -
A backend server expects an
ECHClientofHello .type inner, and proceeds as described in Section 7.2.¶
If ECHClient is not a valid ECHClient, then
the server MUST abort with an "illegal_
In split mode, a client-facing server which receives a ClientHello
with ECHClient of inner MUST abort with an
"illegal_ClientHello with ECHClient of outer
MUST abort with an "illegal_
In shared mode, a server plays both roles, first decrypting the
Client and then using the contents of the
Client. A shared mode server which receives a
ClientHello with ECHClient of inner MUST abort with an
"illegal_ClientHello should never
be received directly from the network.¶
If the "encrypted_
7.1. Client-Facing Server
Upon receiving an "encrypted_ClientHello, the client-facing server determines if it will accept ECH prior
to negotiating any other TLS parameters. Note that successfully decrypting the
extension will result in a new ClientHello to process, so even the client's TLS
version preferences may have changed.¶
First, the server collects a set of candidate ECHConfig values. This list is
determined by one of the two following methods:¶
-
Compare
ECHClientagainst identifiers of each knownHello .config_ id ECHConfigand select the ones that match, if any, as candidates.¶ -
Collect all known
ECHConfigvalues as candidates, with trial decryption below determining the final selection.¶
Some uses of ECH, such as local discovery mode, may randomize the
ECHClient since it can be used as a tracking vector. In such
cases, the second method SHOULD be used for matching the ECHClientHello to a
known ECHConfig. See Section 10.4. Unless specified by the application
profile or otherwise externally configured, implementations MUST use the first
method.¶
The server then iterates over the candidate ECHConfig values, attempting to
decrypt the "encrypted_
The server verifies that the ECHConfig supports the cipher suite indicated by
the ECHClient and that the version of ECH indicated by the
client matches the ECHConfig. If not, the server continues to the next
candidate ECHConfig.¶
Next, the server decrypts ECHClient, using the private key skR
corresponding to ECHConfig, as follows:¶
context = SetupBaseR(ECHClientHello.enc, skR,
"tls ech" || 0x00 || ECHConfig)
EncodedClientHelloInner = context.Open(ClientHelloOuterAAD,
ECHClientHello.payload)
Client is computed from Client as described in
Section 5.2. The info parameter to SetupBaseR is the
concatenation "tls ech", a zero byte, and the serialized ECHConfig. If
decryption fails, the server continues to the next candidate ECHConfig.
Otherwise, the server reconstructs Client from
Encoded, as described in Section 5.1. It then stops
iterating over the candidate ECHConfig values.¶
Once the server has chosen the correct ECHConfig, it MAY verify that the value
in the Client "server_ECHConfig and abort with an "illegal_ECHConfig id or keypair is used in multiple ECHConfigs with distinct public
names.¶
Upon determining the Client, the client-facing server checks that the
message includes a well-formed "encrypted_inner and that it does not offer TLS 1.2 or below. If either of these checks
fails, the client-facing server MUST abort with an "illegal_
If these checks succeed, the client-facing server then forwards the
Client to the appropriate backend server, which proceeds as in
Section 7.2. If the backend server responds with a HelloClient
using the procedure in Section 7.1.1, and forwards the resulting
second Client. The client-facing server forwards all other TLS
messages between the client and backend server unmodified.¶
Otherwise, if all candidate ECHConfig values fail to decrypt the extension, the
client-facing server MUST ignore the extension and proceed with the connection
using Client with the following modifications:¶
-
If sending a Hello
Retry Request, the server MAY include an "encrypted_ client_ hello" extension with a payload of 8 random bytes; see Section 10.10.4 for details.¶ -
If the server is configured with any ECHConfigs, it MUST include the "encrypted_
client_ hello" extension in its Encrypted Extensions with the "retry_ configs" field set to one or more ECHConfigstructures with up-to-date keys. Servers MAY supply multipleECHConfigvalues of different versions. This allows a server to support multiple versions at once.¶
Note that decryption failure could indicate a GREASE ECH extension (see
Section 6.2), so it is necessary for servers to proceed with the connection
and rely on the client to abort if ECH was required. In particular, the
unrecognized value alone does not indicate a misconfigured ECH advertisement
(Section 8.1.1). Instead, servers can measure occurrences of the
"ech_
7.1.1. Processing ClientHello after HelloRetryRequest
After sending or forwarding a HelloClient. Instead, it continues with the ECHConfig selection from the
first Client as follows:¶
If the client-facing server accepted ECH, it checks that the second Client
also contains the "encrypted_ECHClient and ECHClient are unchanged, and that
ECHClient is empty. If not, it MUST abort the handshake with an
"illegal_
Finally, it decrypts the new ECHClient as a second message with the
previous HPKE context:¶
EncodedClientHelloInner = context.Open(ClientHelloOuterAAD,
ECHClientHello.payload)
Client is computed as described in Section 5.2, but
using the second Client. If decryption fails, the client-facing
server MUST abort the handshake with a "decrypt_Client from the new Encoded
as described in Section 5.1, using the second Client for
any referenced extensions.¶
The client-facing server then forwards the resulting Client to the
backend server. It forwards all subsequent TLS messages between the client and
backend server unmodified.¶
If the client-facing server rejected ECH, or if the first ClientHello did not
include an "encrypted_ClientHello's ECHClient value, if there is one.
Moreover, if the server is configured with any ECHConfigs, it MUST include the
"encrypted_ECHConfig structures with up-to-date
keys, as described in Section 7.1.¶
Note that a client-facing server that forwards the first ClientHello cannot
include its own "cookie" extension if the backend server sends a
HelloClientHello.¶
7.2. Backend Server
Upon receipt of an "encrypted_inner in a
ClientHello, if the backend server negotiates TLS 1.3 or higher, then it MUST
confirm ECH acceptance to the client by computing its ServerHello as described
here.¶
The backend server embeds in Server a string derived from the inner
handshake. It begins by computing its ServerHello as usual, except the last 8
bytes of Server are set to zero. It then computes the transcript
hash for Client up to and including the modified ServerHello, as
described in [RFC8446], Section 4.4.1. Let transcript_Server with the following string:¶
accept_confirmation = HKDF-Expand-Label(
HKDF-Extract(0, ClientHelloInner.random),
"ech accept confirmation",
transcript_ech_conf,
8)
where HKDF
The backend server MUST NOT perform this operation if it negotiated TLS 1.2 or below. Note that doing so would overwrite the downgrade signal for TLS 1.3 (see [RFC8446], Section 4.1.3).¶
7.2.1. Sending HelloRetryRequest
When the backend server sends HelloClientHello,
it similarly confirms ECH acceptance by adding a confirmation signal to its
Hello
The backend server begins by computing HelloClient,
denoted Client
hrr_accept_confirmation = HKDF-Expand-Label(
HKDF-Extract(0, ClientHelloInner1.random),
"hrr ech accept confirmation",
transcript_hrr_ech_conf,
8)
In the subsequent ServerHello message, the backend server sends the
accept_ value as described in Section 7.2.¶
8. Deployment Considerations
The design of ECH as specified in this document necessarily requires changes to client, client-facing server, and backend server. Coordination between client-facing and backend server requires care, as deployment mistakes can lead to compatibility issues. These are discussed in Section 8.1.¶
Beyond coordination difficulties, ECH deployments may also create challenges for uses of information that ECH protects. In particular, use cases which depend on this unencrypted information may no longer work as desired. This is elaborated upon in Section 8.2.¶
8.1. Compatibility Issues
Unlike most TLS extensions, placing the SNI value in an ECH extension is not interoperable with existing servers, which expect the value in the existing plaintext extension. Thus, server operators SHOULD ensure servers understand a given set of ECH keys before advertising them. Additionally, servers SHOULD retain support for any previously advertised keys for the duration of their validity.¶
However, in more complex deployment scenarios, this may be difficult to fully guarantee. Thus, this protocol was designed to be robust in case of inconsistencies between systems that advertise ECH keys and servers, at the cost of extra round-trips due to a retry. Two specific scenarios are detailed below.¶
8.1.1. Misconfiguration and Deployment Concerns
It is possible for ECH advertisements and servers to become inconsistent. This
may occur, for instance, from DNS misconfiguratio
The retry mechanism repairs inconsistencies
Unless ECH is disabled as a result of successfully establishing a connection to
the public name, the client MUST NOT fall back to using unencrypted
ClientHellos, as this allows a network attacker to disclose the contents of this
ClientHello, including the SNI. It MAY attempt to use another server from the
DNS results, if one is provided.¶
In order to ensure that the retry mechanism works successfully, servers SHOULD ensure that every endpoint which might receive a TLS connection is provisioned with an appropriate certificate for the public name. This is especially important during periods of server reconfiguration when different endpoints might have different configurations.¶
8.1.2. Middleboxes
The requirements in [RFC8446], Section 9.3 which require proxies to
act as conforming TLS client and server provide interoperabilit
The proxy must ignore unknown parameters and
generate its own ClientHello containing only parameters it understands. Thus,
when presenting a certificate to the client or sending a ClientHello to the
server, the proxy will act as if connecting to the Client
server_
Depending on whether the client is configured to accept the proxy's certificate as authoritative for the public name, this may trigger the retry logic described in Section 6.1.6 or result in a connection failure. A proxy which is not authoritative for the public name cannot forge a signal to disable ECH.¶
8.2. Deployment Impact
Some use cases which depend on information ECH encrypts may break with the deployment of ECH. The extent of breakage depends on a number of external factors, including, for example, whether ECH can be disabled, whether or not the party disabling ECH is trusted to do so, and whether or not client implementations will fall back to TLS without ECH in the event of disablement.¶
Depending on implementation details and deployment settings, use cases which depend on plaintext TLS information may require fundamentally different approaches to continue working. For example, in managed enterprise settings, one approach may be to disable ECH entirely via group policy and for client implementations to honor this action. Server deployments which depend on SNI -- e.g., for load balancing -- may no longer function properly without updates; the nature of those updates is out of scope of this specification.¶
In the context of Section 6.1.6, another approach may be to intercept and decrypt client TLS connections. The feasibility of alternative solutions is specific to individual deployments.¶
9. Compliance Requirements
In the absence of an application profile standard specifying otherwise, a compliant ECH application MUST implement the following HPKE cipher suite:¶
-
KEM: DHKEM(X25519, HKDF-SHA256) (see Section 7.1 of [HPKE])¶
-
KDF: HKDF-SHA256 (see Section 7.2 of [HPKE])¶
-
AEAD: AES-128-GCM (see Section 7.3 of [HPKE])¶
10. Security Considerations
This section contains security considerations for ECH.¶
10.1. Security and Privacy Goals
ECH considers two types of attackers: passive and active. Passive attackers can read packets from the network, but they cannot perform any sort of active behavior such as probing servers or querying DNS. A middlebox that filters based on plaintext packet contents is one example of a passive attacker. In contrast, active attackers can also write packets into the network for malicious purposes, such as interfering with existing connections, probing servers, and querying DNS. In short, an active attacker corresponds to the conventional threat model [RFC3552] for TLS 1.3 [RFC8446].¶
Passive and active attackers can exist anywhere in the network, including between the client and client-facing server, as well as between the client-facing and backend servers when running ECH in split mode. However, for split mode in particular, ECH makes two additional assumptions:¶
-
The channel between each client-facing and each backend server is authenticated such that the backend server only accepts messages from trusted client-facing servers. The exact mechanism for establishing this authenticated channel is out of scope for this document.¶
-
The attacker cannot correlate messages between a client and client-facing server with messages between client-facing and backend server. Such correlation could allow an attacker to link information unique to a backend server, such as their server name or IP address, with a client's encrypted
Client. Correlation could occur through timing analysis of messages across the client-facing server, or via examining the contents of messages sent between client-facing and backend servers. The exact mechanism for preventing this sort of correlation is out of scope for this document.¶Hello Inner
Given this threat model, the primary goals of ECH are as follows.¶
-
Security preservation. Use of ECH does not weaken the security properties of TLS without ECH.¶
-
Handshake privacy. TLS connection establishment to a server name within an anonymity set is indistinguishab
le from a connection to any other server name within the anonymity set. (The anonymity set is defined in Section 1.)¶ -
Downgrade resistance. An attacker cannot downgrade a connection that attempts to use ECH to one that does not use ECH.¶
These properties were formally proven in [ECH-Analysis].¶
With regards to handshake privacy, client-facing server configuration
determines the size of the anonymity set. For example, if a
client-facing server uses distinct ECHConfig values for each server
name, then each anonymity set has size k = 1. Client-facing servers
SHOULD deploy ECH in such a way so as to maximize the size of the
anonymity set where possible. This means client-facing servers should
use the same ECHConfig for as many server names as possible. An
attacker can distinguish two server names that have different
ECHConfig values based on the ECHClientHello.config_ value.¶
This also means public information in a TLS handshake should be consistent across server names. For example, if a client-facing server services many backend origin server names, only one of which supports some cipher suite, it may be possible to identify that server name based on the contents of the unencrypted handshake message. Similarly, if a backend origin reuses KeyShare values, then that provides a unique identifier for that server.¶
Beyond these primary security and privacy goals, ECH also aims to hide, to some extent, the fact that it is being used at all. Specifically, the GREASE ECH extension described in Section 6.2 does not change the security properties of the TLS handshake at all. Its goal is to provide "cover" for the real ECH protocol (Section 6.1), as a means of addressing the "do not stick out" requirements of [RFC8744]. See Section 10.10.4 for details.¶
10.2. Unauthenticated and Plaintext DNS
ECH supports delivery of configurations through the DNS using SVCB or HTTPS records without requiring any verifiable authenticity or provenance information [RFC9848]. This means that any attacker which can inject DNS responses or poison DNS caches, which is a common scenario in client access networks, can supply clients with fake ECH configurations (so that the client encrypts data to them) or strip the ECH configurations from the response. However, in the face of an attacker that controls DNS, no encryption scheme can work because the attacker can replace the IP address, thus blocking client connections, or substitute a unique IP address for each DNS name that was looked up. Thus, using DNS records without additional authentication does not make the situation significantly worse.¶
Clearly, DNSSEC (if the client validates and hard fails) is a defense
against this form of attack, but encrypted DNS transport is also a
defense against DNS attacks by attackers on the local network, which
is a common case where ClientHello and SNI encryption are
desired. Moreover, as noted in the introduction, SNI encryption is
less useful without encryption of DNS queries in transit.¶
10.3. Client Tracking
A malicious client-facing server could distribute unique, per-client ECHConfig
structures as a way of tracking clients across subsequent connections. On-path
adversaries which know about these unique keys could also track clients in this
way by observing TLS connection attempts.¶
The cost of this type of attack scales linearly with the desired number of
target clients. Moreover, DNS caching behavior makes targeting individual users
for extended periods of time, e.g., using per-client ECHConfig structures
delivered via HTTPS RRs with high TTLs, challenging. Clients can help mitigate
this problem by flushing any DNS or ECHConfig state upon changing networks
(this may not be possible if clients use the operating system resolver
rather than doing their own resolution).¶
ECHConfig rotation rate is also an issue for non-malicious servers,
which may want to rotate keys frequently to limit exposure if the key
is compromised. Rotating too frequently limits the client anonymity
set. In practice, servers which service many server names and thus
have high loads are the best candidates to be client-facing servers
and so anonymity sets will typically involve many connections even
with fairly fast rotation intervals.¶
10.4. Ignored Configuration Identifiers and Trial Decryption
Ignoring configuration identifiers may be useful in scenarios where clients and
client-facing servers do not want to reveal information about the client-facing
server in the "encrypted_config_ in the ECHClientHello. Servers in these settings
must perform trial decryption since they cannot identify the client's chosen ECH
key using the config_ value. As a result, ignoring configuration
identifiers may exacerbate DoS attacks. Specifically, an adversary may send
malicious ClientHello messages, i.e., those which will not decrypt with any
known ECH key, in order to force wasteful decryption. Servers that support this
feature should, for example, implement some form of rate limiting mechanism to
limit the potential damage caused by such attacks.¶
Unless specified by the application using (D)TLS or externally configured, client implementations MUST NOT use this mode.¶
10.5. Outer ClientHello
Any information that the client includes in the Client is visible to
passive observers. The client SHOULD NOT send values in the Client
which would reveal a sensitive Client property, such as the true
server name. It MAY send values associated with the public name in the
Client.¶
In particular, some extensions require the client send a serverClientHello. These values may reveal information about the
true server name. For example, the "cached_ClientHello extension
[RFC7924] can contain the hash of a previously observed server certificate.
The client SHOULD NOT send values associated with the true server name in the
Client. It MAY send such values in the Client.¶
A client may also use different preferences in different contexts. For example,
it may send different ALPN lists to different servers or in different
application contexts. A client that treats this context as sensitive SHOULD NOT
send contextClient.¶
Values which are independent of the true server name, or other information the
client wishes to protect, MAY be included in Client. If they match
the corresponding Client, they MAY be compressed as described in
Section 5.1. However, note that the payload length reveals information
about which extensions are compressed, so inner extensions which only sometimes
match the corresponding outer extension SHOULD NOT be compressed.¶
Clients MAY include additional extensions in Client to avoid
signaling unusual behavior to passive observers, provided the choice of value
and value itself are not sensitive. See Section 10.10.4.¶
10.6. Inner ClientHello
Values which depend on the contents of Client, such as the
true server name, can influence how client-facing servers process this message.
In particular, timing side channels can reveal information about the contents
of Client. Implementations should take such side channels into
consideration when reasoning about the privacy properties that ECH provides.¶
10.9. Attacks Exploiting Acceptance Confirmation
To signal acceptance, the backend server overwrites 8 bytes of its
Server with a value derived from the Client. (See
Section 7.2 for details.) This behavior increases the likelihood of the
Server colliding with the Server of a previous session,
potentially reducing the overall security of the protocol. However, the
remaining 24 bytes provide enough entropy to ensure this is not a practical
avenue of attack.¶
On the other hand, the probability that two 8-byte strings are the same is
non-negligible. This poses a modest operational risk. Suppose the client-facing
server terminates the connection (i.e., ECH is rejected or bypassed): if the
last 8 bytes of its Server coincide with the confirmation signal,
then the client will incorrectly presume acceptance and proceed as if the
backend server terminated the connection. However, the probability of a false
positive occurring for a given connection is only 1 in 2^64. This value is
smaller than the probability of network connection failures in practice.¶
Note that the same bytes of the Server are used to implement
downgrade protection for TLS 1.3 (see [RFC8446], Section 4.1.3). These
mechanisms do not interfere because the backend server only signals ECH
acceptance in TLS 1.3 or higher.¶
10.10. Comparison Against Criteria
[RFC8744] lists several requirements for SNI encryption. In this section, we reiterate these requirements and assess the ECH design against them.¶
10.10.1. Mitigate Cut-and-Paste Attacks
Since servers process either Client or Client, and because
Client.random is encrypted, it is not possible for an attacker to "cut
and paste" the ECH value in a different Client Hello and learn information from
Client.¶
10.10.3. SNI-Based Denial-of-Service Attacks
This design requires servers to decrypt ClientHello messages with ECHClientHello
extensions carrying valid digests. Thus, it is possible for an attacker to force
decryption operations on the server. This attack is bound by the number of valid
transport connections an attacker can open.¶
10.10.4. Do Not Stick Out
As a means of reducing the impact of network ossification, [RFC8744] recommends SNI-protection mechanisms be designed in such a way that network operators do not differentiate connections using the mechanism from connections not using the mechanism. To that end, ECH is designed to resemble a standard TLS handshake as much as possible. The most obvious difference is the extension itself: as long as middleboxes ignore it, as required by [RFC8446], the rest of the handshake is designed to look very much as usual.¶
The GREASE ECH protocol described in Section 6.2 provides a low-risk way to evaluate the deployability of ECH. It is designed to mimic the real ECH protocol (Section 6.1) without changing the security properties of the handshake. The underlying theory is that if GREASE ECH is deployable without triggering middlebox misbehavior, and real ECH looks enough like GREASE ECH, then ECH should be deployable as well. Thus, the strategy for mitigating network ossification is to deploy GREASE ECH widely enough to disincentivize differential treatment of the real ECH protocol by the network.¶
Ensuring that networks do not differentiate between real ECH and GREASE ECH may
not be feasible for all implementations
-
The attacker does not know the
ECHConfigListused by the server.¶ -
The attacker keeps per-connection state only. In particular, it does not track endpoints across connections.¶
Moreover, real ECH and GREASE ECH are designed so that the following features do not noticeably vary to the attacker, i.e., they are not distinguishers:¶
-
the code points of extensions negotiated in the clear, and their order;¶
-
the length of messages; and¶
-
the values of plaintext alert messages.¶
This leaves a variety of practical differentiators out-of-scope. including, though not limited to, the following:¶
-
the value of the configuration identifier;¶
-
the value of the outer SNI;¶
-
the TLS version negotiated, which may depend on ECH acceptance;¶
-
client authentication, which may depend on ECH acceptance; and¶
-
HRR issuance, which may depend on ECH acceptance.¶
These can be addressed with more sophisticated implementations
10.10.5. Maintain Forward Secrecy
This design does not provide forward secrecy for the inner ClientHello
because the server's ECH key is static. However, the window of
exposure is bound by the key lifetime. It is RECOMMENDED that servers
rotate keys regularly.¶
10.10.6. Enable Multi-party Security Contexts
This design permits servers operating in split mode to forward connections directly to backend origin servers. The client authenticates the identity of the backend origin server, thereby allowing the backend origin server to hide behind the client-facing server without the client-facing server decrypting and reencrypting the connection.¶
Conversely, if the DNS records used for configuration are authenticated, e.g., via DNSSEC, spoofing a client-facing server operating in split mode is not possible. See Section 10.2 for more details regarding plaintext DNS.¶
Authenticating the ECHConfig structure naturally authenticates the included
public name. This also authenticates any retry signals from the client-facing
server because the client validates the server certificate against the public
name before retrying.¶
10.10.7. Support Multiple Protocols
This design has no impact on application layer protocol negotiation. It may
affect connection routing, server certificate selection, and client certificate
verification. Thus, it is compatible with multiple application and transport
protocols. By encrypting the entire ClientHello, this design additionally
supports encrypting the ALPN extension.¶
10.11. Padding Policy
Variations in the length of the Client ciphertext could leak
information about the corresponding plaintext. Section 6.1.3 describes a
RECOMMENDED padding mechanism for clients aimed at reducing potential
information leakage.¶
10.12. Active Attack Mitigations
This section describes the rationale for ECH properties and mechanics as
defenses against active attacks. In all the attacks below, the attacker is
on-path between the target client and server. The goal of the attacker is to
learn private information about the inner ClientHello, such as the true SNI
value.¶
10.12.1. Client Reaction Attack Mitigation
This attack uses the client's reaction to an incorrect certificate as an oracle.
The attacker intercepts a legitimate ClientHello and replies with a ServerHello,
Certificate, CertificateClientHello is "example.com," and
the attacker replied with a Certificate for "test.com". If the client produces a
verification failure alert because of the mismatch faster than it would due to
the Certificate signature validation, information about the name leaks. Note
that the attacker can also withhold the Certificate
Client Attacker Server
ClientHello
+ key_share
+ ech ------> (intercept) -----> X (drop)
ServerHello
+ key_share
{EncryptedExtensions}
{CertificateRequest*}
{Certificate*}
{CertificateVerify*}
<------
Alert
------>
Client prevents this attack: because the attacker
does not have access to this value, it cannot produce the right transcript and
handshake keys needed for encrypting the Certificate message. Thus, the client
will fail to decrypt the Certificate and abort the connection.¶
10.12.2. HelloRetryRequest Hijack Mitigation
This attack aims to exploit server HRR state management to recover information
about a legitimate ClientHello using its own attackerClientHello.
To begin, the attacker intercepts and forwards a legitimate ClientHello with an
"encrypted_ClientHello in response based
on the contents of the first ClientHello and HelloClientHello and the key share from the second
ClientHello, the Certificate produced would leak the
client's chosen SNI to the attacker.¶
Client Attacker Server
ClientHello
+ key_share
+ ech ------> (forward) ------->
HelloRetryRequest
+ key_share
(intercept) <-------
ClientHello
+ key_share'
+ ech' ------->
ServerHello
+ key_share
{EncryptedExtensions}
{CertificateRequest*}
{Certificate*}
{CertificateVerify*}
{Finished}
<-------
(process server flight)
This attack is mitigated by using the same HPKE context for both ClientHello
messages. The attacker does not possess the context's keys, so it cannot
generate a valid encryption of the second inner ClientHello.¶
If the attacker could manipulate the second ClientHello, it might be possible
for the server to act as an oracle if it required parameters from the first
ClientHello to match that of the second ClientHello. For example, imagine the
client's original SNI value in the inner ClientHello is "example.com", and the
attacker's hijacked SNI value in its inner ClientHello is "test.com". A server
which checks these for equality and changes behavior based on the result can be
used as an oracle to learn the client's SNI.¶
10.12.3. ClientHello Malleability Mitigation
This attack aims to leak information about secret parts of the encrypted
ClientHello by adding attackerClient to construct Client, or a buggy server may
incorrectly apply parameters from Client to the handshake.¶
To begin, the attacker first interacts with a server to obtain a resumption
ticket for a given test domain, such as "example.com". Later, upon receipt of a
Client, it modifies it such that the server will process the
resumption ticket with Client. If the server only accepts resumption
PSKs that match the server name, it will fail the PSK binder check with an
alert when Client is for "example.com" but silently ignore the PSK
and continue when Client is for any other name. This introduces an
oracle for testing encrypted SNI values.¶
Client Attacker Server
handshake and ticket
for "example.com"
<-------->
ClientHello
+ key_share
+ ech
+ ech_outer_extensions(pre_shared_key)
+ pre_shared_key
-------->
(intercept)
ClientHello
+ key_share
+ ech
+ ech_outer_extensions(pre_shared_key)
+ pre_shared_key'
-------->
Alert
-or-
ServerHello
...
Finished
<--------
This attack may be generalized to any parameter which the server varies by server name, such as ALPN preferences.¶
ECH mitigates this attack by only negotiating TLS parameters from
Client and authenticating all inputs to the Client
(Encoded and Client) with the HPKE AEAD. See
Section 5.2. The decompression process in Section 5.1
forbids "encrypted_Client is not incorporated into
Client. An earlier iteration of this specification only
encrypted and authenticated the "server_ClientHello vulnerable to an analogue of this attack.¶
10.12.4. ClientHelloInner Packet Amplification Mitigation
Client-facing servers must decompress Encoded
-
If looking up a
Clientextension takes time linear in the number of extensions, the overall decoding process would take O(M*N) time, where M is the number of extensions inHello Outer Clientand N is the size of OuterHello Outer Extensions .¶ -
If the same
Clientextension can be copied multiple times, an attacker could cause the client-facing server to construct a largeHello Outer Clientby including a large extension inHello Inner Clientof length L and an OuterHello Outer Extensions list referencing N copies of that extension. The client-facing server would then use O(N*L) memory in response to O(N+L) bandwidth from the client. In split mode, an O(N*L)-sized packet would then be transmitted to the backend server.¶
ECH mitigates this attack by requiring that Outer
11. IANA Considerations
11.1. Update of the TLS ExtensionType Registry
IANA has created the following entries in the existing "TLS ExtensionType Values" registry (defined in [RFC8446]):¶
-
encrypted_
client_ hello (0xfe0d), with "TLS 1.3" column values set to "CH, HRR, EE", "DTLS-Only" column set to "N", and "Recommended" column set to "Y".¶ -
ech_
outer_ extensions (0xfd00), with the "TLS 1.3" column values set to "CH", "DTLS-Only" column set to "N", "Recommended" column set to "Y", and the "Comment" column set to "Only appears in inner CH."¶
11.2. Update of the TLS Alert Registry
IANA has created an entry, ech_
11.3. ECH Configuration Extension Registry
IANA has created a new "TLS ECHConfig Extension" registry in a new "TLS Encrypted Client Hello (ECH) Configuration Extensions" registry group. New registrations will list the following attributes:¶
- Value:
-
The two-byte identifier for the ECHConfig
Extension, i.e., the ECHConfig Extension Type¶ - Extension Name:
-
Name of the ECHConfig
Extension¶ - Recommended:
-
A "Y" or "N" value indicating if the TLS Working Group recommends that the extension be supported. This column is assigned a value of "N" unless explicitly requested. Adding a value of "Y" requires Standards Action [RFC8126].¶
- Reference:
-
The specification where the ECHConfig
Extension is defined¶ - Notes:
-
Any notes associated with the entry¶
New entries in the "TLS ECHConfig Extension" registry are subject to the Specification Required registration policy ([RFC8126], Section 4.6), with the policies described in [RFC9847], Section 16. IANA has added the following note to the "TLS ECHConfig Extension" registry:¶
Note: The role of the designated expert is described in RFC 9847. The designated expert [RFC8126] ensures that the specification is publicly available. It is sufficient to have an Internet-Draft (that is posted and never published as an RFC) or a document from another standards body, industry consortium, university site, etc. The expert may provide more in-depth reviews, but their approval should not be taken as an endorsement of the extension.¶
This document defines several Reserved values for ECH configuration extensions to be used for "greasing" as described in Section 6.2.2.¶
The initial contents for this registry consists of multiple reserved values with the following attributes, which are repeated for each registration:¶
12. References
12.1. Normative References
- [HPKE]
-
Barnes, R., Bhargavan, K., Lipp, B., and C. Wood, "Hybrid Public Key Encryption", RFC 9180, DOI 10
.17487 , , <https:///RFC9180 www >..rfc -editor .org /info /rfc9180 - [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC5890]
-
Klensin, J., "Internationaliz
ed Domain Names for Applications (IDNA): Definitions and Document Framework" , RFC 5890, DOI 10.17487 , , <https:///RFC5890 www >..rfc -editor .org /info /rfc5890 - [RFC7918]
-
Langley, A., Modadugu, N., and B. Moeller, "Transport Layer Security (TLS) False Start", RFC 7918, DOI 10
.17487 , , <https:///RFC7918 www >..rfc -editor .org /info /rfc7918 - [RFC8126]
-
Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10
.17487 , , <https:///RFC8126 www >..rfc -editor .org /info /rfc8126 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174 - [RFC8446]
-
Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10
.17487 , , <https:///RFC8446 www >..rfc -editor .org /info /rfc8446 - [RFC9147]
-
Rescorla, E., Tschofenig, H., and N. Modadugu, "The Datagram Transport Layer Security (DTLS) Protocol Version 1.3", RFC 9147, DOI 10
.17487 , , <https:///RFC9147 www >..rfc -editor .org /info /rfc9147 - [RFC9460]
-
Schwartz, B., Bishop, M., and E. Nygren, "Service Binding and Parameter Specification via the DNS (SVCB and HTTPS Resource Records)", RFC 9460, DOI 10
.17487 , , <https:///RFC9460 www >..rfc -editor .org /info /rfc9460 - [RFC9525]
-
Saint-Andre, P. and R. Salz, "Service Identity in TLS", RFC 9525, DOI 10
.17487 , , <https:///RFC9525 www >..rfc -editor .org /info /rfc9525 - [RFC9847]
-
Salowey, J. and S. Turner, "IANA Registry Updates for TLS and DTLS", RFC 9847, DOI 10
.17487 , , <https:///RFC9847 www >..rfc -editor .org /info /rfc9847
12.2. Informative References
- [DNS-TERMS]
-
Hoffman, P. and K. Fujiwara, "DNS Terminology", BCP 219, RFC 9499, DOI 10
.17487 , , <https:///RFC9499 www >..rfc -editor .org /info /rfc9499 - [ECH-Analysis]
-
Bhargavan, K., Cheval, V., and C. Wood, "A Symbolic Analysis of Privacy for TLS 1.3 with Encrypted Client Hello", CCS '22: Proceedings of the 2022 ACM SIGSAC Conference on Computer and Communications Security, pp. 365-379, DOI 10
.1145 , , <https:///3548606 .3559360 www >..cs .ox .ac .uk /people /vincent .cheval /publis /BCW -ccs22 .pdf - [PROTECTED-SNI]
-
Oku, K., "TLS Extensions for Protecting SNI", Work in Progress, Internet-Draft, draft
-kazuho , , <https://-protected -sni -00 datatracker >..ietf .org /doc /html /draft -kazuho -protected -sni -00 - [RFC3552]
-
Rescorla, E. and B. Korver, "Guidelines for Writing RFC Text on Security Considerations", BCP 72, RFC 3552, DOI 10
.17487 , , <https:///RFC3552 www >..rfc -editor .org /info /rfc3552 - [RFC3986]
-
Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10
.17487 , , <https:///RFC3986 www >..rfc -editor .org /info /rfc3986 - [RFC5077]
-
Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, "Transport Layer Security (TLS) Session Resumption without Server-Side State", RFC 5077, DOI 10
.17487 , , <https:///RFC5077 www >..rfc -editor .org /info /rfc5077 - [RFC7301]
-
Friedl, S., Popov, A., Langley, A., and E. Stephan, "Transport Layer Security (TLS) Application
-Layer Protocol Negotiation Extension" , RFC 7301, DOI 10.17487 , , <https:///RFC7301 www >..rfc -editor .org /info /rfc7301 - [RFC7858]
-
Hu, Z., Zhu, L., Heidemann, J., Mankin, A., Wessels, D., and P. Hoffman, "Specification for DNS over Transport Layer Security (TLS)", RFC 7858, DOI 10
.17487 , , <https:///RFC7858 www >..rfc -editor .org /info /rfc7858 - [RFC7924]
-
Santesson, S. and H. Tschofenig, "Transport Layer Security (TLS) Cached Information Extension", RFC 7924, DOI 10
.17487 , , <https:///RFC7924 www >..rfc -editor .org /info /rfc7924 - [RFC8094]
-
Reddy, T., Wing, D., and P. Patil, "DNS over Datagram Transport Layer Security (DTLS)", RFC 8094, DOI 10
.17487 , , <https:///RFC8094 www >..rfc -editor .org /info /rfc8094 - [RFC8484]
-
Hoffman, P. and P. McManus, "DNS Queries over HTTPS (DoH)", RFC 8484, DOI 10
.17487 , , <https:///RFC8484 www >..rfc -editor .org /info /rfc8484 - [RFC8701]
-
Benjamin, D., "Applying Generate Random Extensions And Sustain Extensibility (GREASE) to TLS Extensibility", RFC 8701, DOI 10
.17487 , , <https:///RFC8701 www >..rfc -editor .org /info /rfc8701 - [RFC8744]
-
Huitema, C., "Issues and Requirements for Server Name Identification (SNI) Encryption in TLS", RFC 8744, DOI 10
.17487 , , <https:///RFC8744 www >..rfc -editor .org /info /rfc8744 - [RFC9250]
-
Huitema, C., Dickinson, S., and A. Mankin, "DNS over Dedicated QUIC Connections", RFC 9250, DOI 10
.17487 , , <https:///RFC9250 www >..rfc -editor .org /info /rfc9250 - [RFC9848]
-
Schwartz, B., Bishop, M., and E. Nygren, "Bootstrapping TLS Encrypted ClientHello with DNS Service Bindings", RFC 9848, DOI 10
.17487 , , <https:///RFC9848 www >..rfc -editor .org /info /rfc9848 - [WHATWG-IPV4]
-
WHATWG, "URL - IPv4 Parser", WHATWG Living Standard, , <https://
url >. Commit snapshot: <https://.spec .whatwg .org / url >..spec .whatwg .org /commit -snapshots /1b8b8c55eb4bed9 f139c9a439fb1c1b f5566b619 /#concept -ipv4 -parser
Appendix A. Linear-Time Outer Extension Processing
The following procedure processes the "ech_Client is included at most once:¶
-
Let I be initialized to zero and N be set to the number of extensions in
Client.¶Hello Outer -
For each extension type, E, in Outer
Extensions :¶ -
If E is "encrypted_
client_ hello", abort the connection with an "illegal_ parameter" alert and terminate this procedure.¶ -
While I is less than N and the I-th extension of
Clientdoes not have type E, increment I.¶Hello Outer -
If I is equal to N, abort the connection with an "illegal_
parameter" alert and terminate this procedure.¶ -
Otherwise, the I-th extension of
Clienthas type E. Copy it to theHello Outer Encodedand increment I.¶Client Hello Inner
-
Acknowledgements
This document draws extensively from ideas in [PROTECTED-SNI], but is a much more limited mechanism because it depends on the DNS for the protection of the ECH key. Richard Barnes, Christian Huitema, Patrick McManus, Matthew Prince, Nick Sullivan, Martin Thomson, and David Benjamin also provided important ideas and contributions.¶