Early-Data: requests sent before the handshake finished
Early-Data marks a request that arrived in TLS early data, which saves a round trip but can be replayed by an attacker, so unsafe requests should be refused.
At a glance
- Direction
- Request, added by an intermediary rather than by the client itself.
- Defined in
- RFC 8470
- When absent
- The request was not sent in early data, or nothing on the path chose to mark it.
- Only value
- 1
- Set by
- A proxy or terminator that forwards a request received in early data
- Correct refusal
- 425 Too Early, which asks the client to retry on a fully established connection
- Risk
- Replay. Early data can be captured and resent by an attacker.
In detail
TLS 1.3 lets a client that has connected before send data in its first flight, saving a round trip. The saving is real on a high latency connection, and so is the cost: early data has no protection against replay, so an attacker who captures those bytes can send them again later and the server cannot tell the difference.
That makes early data acceptable for safe, idempotent requests and unacceptable for anything that changes state. A replayed GET wastes a little work; a replayed payment or a replayed delete does exactly what it says twice. The header exists so an application behind a terminating proxy can tell the two situations apart, since it never sees the handshake itself.
The intended response for an unsafe request is 425 Too Early, which tells the client to retry once the handshake completes. Browsers handle that automatically, so the cost of refusing is one extra round trip for the small set of requests that genuinely need it, rather than a visible failure.
The header is added by whatever terminates TLS, so it can be forged by a client if you trust it from anywhere. Treat it exactly like the forwarded headers: honour it only from your own edge, and ignore it entirely when the request arrived from somewhere you do not control.
Examples
POST /api/payments HTTP/1.1
Host: api.example.com
Early-Data: 1HTTP/1.1 425 Too Early
Content-Type: application/json
{"error":"retry_after_handshake"}Browsers retry this automatically on a fully established connection.
Things that catch people out
- Accepting early data for state changing requests exposes them to replay, which is the one risk the whole mechanism carries.
- The header is client supplied unless your own edge sets it, so trusting it from an arbitrary source is the usual forwarded header mistake in a new place.
- Answering 425 for safe requests throws away the round trip saving without gaining anything.
Try it: HTTP Headers Checker
Check a live URL or paste headers you already have. It grades six security headers from A+ to F and lists every other header the response returned.
HTTP Headers Checker
LOCAL · Browser-OnlyView HTTP response headers for any URL
Enter any website URL to fetch and analyze its HTTP response headers. We'll automatically add https:// if needed.
Why Check Security Headers?
Security headers protect your website against common attacks like XSS, clickjacking, and MIME sniffing. They're set by your web server and cost nothing to implement. Missing security headers are one of the most common findings in security audits.
Related HTTP headers
All http headers →Connection: keep-alive, close and hop by hop headers
What the Connection header controls, how it lists hop by hop headers, why HTTP/1.1 keeps connections open by default, and why HTTP/2 forbids it.
X-Forwarded-Proto: the scheme the client actually used
Why an application behind a proxy cannot see the client scheme, how X-Forwarded-Proto restores it, and the redirect loop that follows from ignoring it.
Retry-After: when to try the request again
The two formats Retry-After accepts, which statuses it belongs on, why a fixed value causes synchronised retries, and how clients should treat it.
Authorization: credentials on a request
How the Authorization header is structured, how Basic and Bearer differ, why it is dropped across a cross-host redirect, and how it interacts with caching.
X-Powered-By: a header worth removing
What X-Powered-By discloses, why frameworks add it by default, what removing it actually buys you, and which related headers leak the same information.
Strict-Transport-Security: the HSTS response header
What Strict-Transport-Security does, what max-age and includeSubDomains change, why preload is close to permanent, and how to withdraw the policy safely.
Tools for this
- HTTP Headers Checker Free online HTTP headers checker - view HTTP response headers for any URL
- SSL Certificate Checker Free online SSL certificate checker - check SSL certificate details and expiration