rfc-8470

Using Early Data in HTTP

M. Thomson, M. Nottingham, W. Tarreau
date2018-09 streamIETF areawit wghttpbis statusPROPOSED STANDARD pages12 canonicalhttps://www.rfc-editor.org/rfc/rfc8470 doi10.17487/RFC8470
Using TLS early data creates an exposure to the possibility of a replay attack. This document defines mechanisms that allow clients to communicate with servers about HTTP requests that are sent in early data. Techniques are described that use these mechanisms to mitigate the risk of replay.

Extracted elements (27)

design-rationale §5

Because HTTP requests can span multiple hops, two explicit signaling mechanisms are needed: the Early-Data header field (to indicate a request arrived in early data on a prior hop) and the 425 (Too Early) status code (to trigger a retry). Gateways typically lack the information to decide replay safety; only the origin server has that context.

http, tls, security

design-rationale §5.1

The Early-Data header field carries only a single bit of information (value "1") because what matters is not the details of the early data exchange but simply whether the client understands and is willing to retry on receipt of a 425 (Too Early) response. User agents do not need to set it; their act of sending in early data implies this willingness.

http, tls

interoperability-note §1

The advice and mechanisms in this document apply equally to the use of 0-RTT in HTTP over QUIC (HTTP/QUIC), not only HTTP over TLS 1.3.

http, quic, tls

normative-requirement §6.1 MUST NOT

A gateway MUST NOT forward requests received in early data unless it knows the origin server understands the Early-Data header field and will correctly generate a 425 (Too Early) status code. An uncertain gateway SHOULD delay forwarding until the TLS handshake completes or respond with 425 directly.

http, tls, security

normative-requirement §6.2 MUST NOT

A server MUST NOT act on early data before the TLS handshake completes if it and any other server instance could make a different decision about how to handle the same data, to prevent inconsistent replay handling across instances.

http, tls, security

normative-requirement §6.3 SHOULD

A server that is under load SHOULD prefer rejecting TLS early data as a whole rather than accepting early data and selectively processing requests, to avoid amplifying load through client retries triggered by 503 or 425 responses.

http, tls, security

normative-requirement §5.2 SHOULD

A user agent that receives a 425 (Too Early) response SHOULD retry automatically, but any retries MUST NOT be sent in early data.

http, tls

normative-requirement §3 MUST

Absent explicit per-resource configuration, origin servers MUST either reject early data entirely or implement the techniques in this document to ensure requests are not processed prior to TLS handshake completion.

http, tls, security

normative-requirement §5.1 MUST

An intermediary forwarding a request before TLS handshake completion with its client MUST add the Early-Data header field set to "1" if not already present, and MUST NOT remove the field if it is present.

http, tls

normative-requirement §5.2 MUST

An intermediary MUST forward a 425 (Too Early) status code if the request it received and forwarded contained an Early-Data header field. Otherwise, an intermediary that received the request in early data MAY retry that request in response to 425, but MUST wait for the TLS handshake to complete first.

http, tls

normative-requirement §4 MUST NOT

An intermediary MUST NOT use early data when forwarding a request unless early data was used on a previous hop, or it has out-of-band knowledge that the request can be retried safely. Absent better information, this means the request must have arrived in early data or with Early-Data: 1.

http, tls, security

normative-requirement §4 MUST NOT

Clients MAY send requests with safe HTTP methods in early data when available, but MUST NOT send unsafe methods (or methods whose safety is unknown) in early data.

http, tls, security

normative-requirement §4 MUST

Clients that use early data MUST retry requests upon receipt of a 425 (Too Early) status code.

http, tls

normative-requirement §5.1 MUST NOT

Early-Data MUST NOT appear in a Connection header field, MUST NOT be included in responses, and MUST NOT appear in request trailers.

http

normative-requirement §4 MUST

If the server rejects early data at the TLS layer, a client MUST start sending again as though the connection were new, which may require a different negotiated application protocol.

http, tls

normative-requirement §3 MUST

Intermediaries that accept early data MUST implement the 425 (Too Early) mechanism so that the origin can signal that a particular request is not appropriate for early data processing.

http, tls

normative-requirement §3 RECOMMENDED

It is RECOMMENDED that origin servers allow resources to explicitly configure whether early data is appropriate for incoming requests.

http, tls

normative-requirement §3 MUST

Once a server has decided to accept TLS early data, it MUST process all requests received in early data, even if it ultimately rejects individual requests with a 425 (Too Early) response. TLS does not permit selective rejection of early data.

http, tls

normative-requirement §5.1 MUST

Requests that contain the Early-Data header field and cannot be safely processed MUST be rejected using the 425 (Too Early) status code. A server cannot make such a request safe by waiting for the handshake to complete, because the early data already occurred on a prior hop.

http, tls, security

protocol-element §5.2

The 425 (Too Early) status code indicates the server is unwilling to risk processing a request that might be replayed. It is not cacheable by default and its payload is not a representation of any identified resource.

http, tls, security

protocol-element §5.1

The Early-Data request header field signals that the request has been conveyed in early data and that the client understands the 425 (Too Early) status code. It has exactly one valid value: "1". User agents sending early-data requests do not need to include this header; it is intended for intermediaries.

http, tls

registry §7

This document registers the 425 (Too Early) status code in the IANA "HTTP Status Codes" registry.

registry, http

registry §7

This document registers the Early-Data header field in the IANA "Permanent Message Header Field Names" registry, applicable to HTTP, with status "standard".

registry, http

security-consideration §6.2

Consistent treatment of requests arriving fully or partially in early data is critical: if any server instance might initiate processing before TLS handshake completion, all instances must account for possible replay. Disabling early data, delaying, or rejecting with 425 are equally valid and may be chosen per-instance based on conditions such as server load.

security, tls, http

security-consideration §6.4

In protocols with out-of-order delivery such as QUIC, early data can arrive after the handshake completes. A server MAY process such requests after handshake completion only if it can rely on other instances correctly handling replays of the same requests.

security, tls, quic, http

security-consideration §6

Using early data exposes a client to the risk that their request is replayed by an attacker. Replayed or retried requests can produce different side effects on the server and may be used for traffic analysis to recover information about requests or target resources, even when content is confidential (via response length differences).

security, tls, http, privacy

wire-format §5.1

The Early-Data header field has a single ABNF production: `Early-Data = "1"`. Only the value "1" is valid; multiple or invalid instances MUST be treated as equivalent to a single instance with value "1".

http, tls, json