Early-Data
The HTTP Early-Data request header signals the request was sent in TLS 1.3 early data (0-RTT) and warns downstream servers of potential replay attack risk.
Usage
TLS 1.3 introduces early data, also called 0-RTT (zero round-trip time), which allows clients to send application data during the first flight of a connection without waiting for the TLS handshake to complete. This eliminates one or two round trips of latency when establishing HTTPS connections.
The performance benefit comes with a security trade-off. Early data has no replay protection. An attacker capturing the encrypted early data packets sends them again to the server, causing the request to execute multiple times. For safe methods (GET, HEAD, OPTIONS), replay has no harmful effect because safe methods have no side effects. For unsafe methods (POST, PUT, DELETE), replay causes unintended duplicate operations like double purchases or multiple account modifications.
The Early-Data header is set to 1 by intermediaries (CDNs, load
balancers, reverse proxies) when forwarding a request arriving in TLS
1.3 early data. The header alerts downstream servers and applications
to the replay risk. Servers restrict early data requests to safe methods
or reject them with a 425 (Too Early) status code.
The specification defines replay mitigation techniques. Akamai, Cloudflare, and other CDN providers support early data with this signaling mechanism.
Values
1
The only valid value. An intermediary sets Early-Data to 1 when
forwarding a request received in TLS 1.3 early data. The presence of
this header with value 1 indicates replay risk.
Example
A reverse proxy forwards a GET request arriving in TLS 1.3 early data. The downstream origin server sees the header and processes the request normally since GET is idempotent.
Early-Data: 1
A POST request arrives in early data. The downstream server sees the header and rejects the request with a 425 status code, forcing the client to retry the request in fully protected 1-RTT data.
Early-Data: 1
Takeaway
The Early-Data header marks requests sent in TLS 1.3 0-RTT early data, alerting servers to potential replay attacks and enabling them to restrict processing to safe operations or reject the request.