Skip to content

Commit 33765cf

Browse files
committed
BUG/MINOR: quic: drop multiple Retry on same connection
Ensures that only a single Retry packet is handled by a QUIC haproxy client per connection. This is mandated by RFC 9000. The first received token should still be sufficient to validate the connection. This change is applied directly in quic_rx_pkt_parse(). In case of multiple Retry, packets are silently ignored, whether token is identical or not. This fix is particularly important to prevent a memory leak on several elements, first <retry_token> member of quic_conn. This also concerns elements from the TLS stack as initial encryption level would be reinitialized needlessly. Reported-by: Claude (ANT-2026-CJ4Z875H) This must be backported up to 3.3.
1 parent 1a4f4b4 commit 33765cf

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/quic_rx.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,6 +2062,19 @@ static int quic_rx_pkt_parse(struct quic_conn *qc, struct quic_rx_packet *pkt,
20622062
goto drop;
20632063
}
20642064

2065+
/* RFC 9000 17.2.5.2. Handling a Retry Packet
2066+
*
2067+
* A client MUST accept and process at most one Retry packet for each
2068+
* connection attempt. After the client has received and processed an
2069+
* Initial or Retry packet from the server, it MUST discard any
2070+
* subsequent Retry packets that it receives.
2071+
*/
2072+
if (qc->retry_token) {
2073+
TRACE_PROTO("Drop duplicate Retry packet",
2074+
QUIC_EV_CONN_LPKT, NULL, NULL, NULL, pkt->version);
2075+
goto drop_silent;
2076+
}
2077+
20652078
if (!quic_retry_packet_check(qc, pkt, beg, end, pos, &qc->retry_token_len))
20662079
/* TODO: should close the connection? */
20672080
goto drop;

0 commit comments

Comments
 (0)