awesome-everything RU
↑ Back to the climb

Networking & Protocols

0-RTT resumption and packet encryption

Crux QUIC''''s 0-RTT resumption lets clients piggyback data on the first packet — but without replay protection. Almost-full packet encryption eliminates passive sniffing and RST injection at the cost of operational opacity.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 14 min

A user revisits a site they visited yesterday. Their browser has a session ticket. QUIC sends the HTTP request in the very first packet — zero round trips — before the server even responds. But if an attacker intercepts and replays that first packet, the server will execute the request twice.

0-RTT resumption mechanics

On subsequent connections to the same server, the client can reuse a cached session ticket — a blob of encrypted TLS state the server issued at the end of the previous connection. The client includes this ticket in the ClientHello and attaches application data (0-RTT data) in the same Initial packet.

The server receives the Initial, decrypts the session ticket (which contains the resumption keys), and can immediately process the 0-RTT data — without waiting for a full handshake.

Latency: 0 RTT before the server processes the first request. On a 100 ms link, this is 100 ms saved on a reconnection — on top of the 100 ms already saved by the 1-RTT handshake vs. TCP+TLS.

The replay vulnerability

0-RTT data is encrypted with the session ticket’s symmetric key. An on-path attacker who captures the Initial packet can replay the entire packet to the server later. Because 0-RTT lacks TLS record-level replay protection, the server will receive and process the replayed request.

Concrete attack: Alice sends POST /api/transfer amount=5000 from=alice to=bob in 0-RTT. An attacker captures and replays the packet. The server executes the transfer twice: Alice loses 10,000 instead of 5,000.

The defense:

  1. Restrict 0-RTT to idempotent requests only. GET, HEAD, and safe operations are safe — replaying them produces the same result. POST, DELETE, and state-changing operations must wait for 1-RTT keys.
  2. 425 Too Early response. When the server forwards 0-RTT to an origin backend it includes an Early-Data: 1 header. The origin can respond 425 (Too Early) forcing the client to retry after the full handshake (RFC 8470).
  3. Session ticket isolation. Servers should not share session ticket keys across data centers — a ticket from Server A should only be valid on Server A. Short ticket lifetimes (1–24 hours) limit the replay window.
Trace it
1/5

Trace a QUIC 0-RTT attack and the defense.

1
Step 1 of 5
Client connects to server.example.com and receives a session ticket. Later it opens a new connection with 0-RTT data in ClientHello: POST /api/transfer amount=5000 from=alice to=bob.
2
Locked
An on-path attacker captures the entire Initial packet containing the 0-RTT POST. What can the attacker do?
3
Locked
The server executes the same transfer twice. How does the server defend against this?
4
Locked
The server forwards the 0-RTT to an origin backend. What header must it include?
5
Locked
Can the attacker replay the same 0-RTT packet to a different server (example.com's backup replica)?

Almost-full packet encryption

TCP headers are cleartext — source/dest IP, ports, sequence numbers are all visible to any observer. QUIC encrypts almost everything:

Long-form headers (handshake and Initial packets):

  • Unencrypted: outermost 4 bytes (version + connection ID length) and the Connection ID itself.
  • Encrypted: packet number, payload — using the appropriate level’s key.

Short-form headers (post-handshake packets):

  • Carry only the connection ID and encrypted packet number + payload.
  • Almost entirely opaque to observers.

Security consequences:

  • An on-path attacker cannot inject RST packets — they cannot construct a valid encrypted packet without the 1-RTT key. TCP’s RST injection vulnerability is eliminated.
  • Passive sniffing of stream contents is eliminated — all stream data is 1-RTT encrypted.
  • Traffic analysis based on sequence numbers is impossible without decryption.

Operational consequence: tcpdump of QUIC traffic shows only opaque blobs. Network engineers cannot count HTTP requests per endpoint, identify slow clients, or detect misbehavior at the packet level without application-level instrumentation.

QUIC vs TCP: what is visible to a network observer
TCP (cleartext)
Source / Dest IP: visible
Source / Dest Port: visible
Sequence numbers: visible
SYN/FIN/RST flags: visible
TLS payload: encrypted (if TLS)
QUIC (post-handshake)
Source / Dest IP: visible (IP header)
UDP Port: visible
Connection ID: visible
Packet number: encrypted
Payload / stream data: encrypted
Quiz

In QUIC, why is 0-RTT data vulnerable to replay but TCP Fast Open (TFO) is not?

Quiz

Why does QUIC's almost-full packet encryption break traditional network monitoring?

Which RFC?

Which RFC standardizes the 425 (Too Early) HTTP response code and the Early-Data header used to protect against 0-RTT replay?

Edge cases

Comparing 0-RTT replay defence to TCP Fast Open: TCP Fast Open stores a cookie issued by the server, which includes a server-computed HMAC and TTL. The server validates the cookie at request time — if expired, TFO is rejected and a standard handshake is forced. This built-in temporal validation protects TFO from replay without application involvement. QUIC’s 0-RTT lacks this: the session ticket’s validity is controlled by the ticket lifetime, and within that lifetime the ciphertext can be replayed. This is why RFC 9001 mandates application-level idempotency enforcement rather than relying on TLS for replay protection.

0-RTT and encryption trade-offs
0-RTT latency saving on reconnect
100 ms on 100 ms link
0-RTT replay risk
any non-idempotent request
Packet types with long headers
Initial, 0-RTT, Handshake, Retry
Packet types with short headers
1-RTT (post-handshake)
TCP RST injection surface eliminated
yes (no valid RST constructable)
Recall before you leave
  1. 01
    Explain why QUIC's 0-RTT is vulnerable to replay but TCP Fast Open is not.
  2. 02
    What is the 425 Too Early response code and when should an origin server send it?
  3. 03
    Why does QUIC's almost-full packet encryption break traditional packet-level network monitoring?
Recap

0-RTT resumption uses a cached session ticket to attach application data to the ClientHello — zero round trips for reconnected clients. The cost is replay vulnerability: an on-path attacker can capture and replay the 0-RTT ciphertext, executing non-idempotent operations twice. The defense is three-part: restrict 0-RTT to safe/idempotent requests, use the 425 Too Early mechanism for non-idempotent cases forwarded by proxies, and isolate session ticket keys per server to prevent cross-datacenter replay. QUIC’s almost-full packet encryption goes beyond what TLS alone provides: short-form headers encrypt packet numbers and all stream data, preventing RST injection attacks and making passive sniffing impossible. The trade-off is operational opacity — network engineers must instrument at the application layer rather than the packet layer.

Connected lessons
appears again in258
Continue the climb ↑Deployment tradeoffs and CPU cost
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.