From: Vadim Zhestikov Date: Fri, 6 Nov 2026 21:42:48 +0000 (-0800) Subject: QUIC: shared a zero-length client connection id between paths X-Git-Url: https://git.kaiwu.me/http/%22..//%22?a=commitdiff_plain;h=ffb1810fd8ad2e855314f33bfa025005bb687d2d;p=nginx.git QUIC: shared a zero-length client connection id between paths A client that selected a zero-length connection id during the handshake cannot issue new connection ids, and a zero-length Destination Connection ID field is used in all packets sent toward such an endpoint over any network path, see RFC 9000, 5.1.1. Instead, a new path was required to have its own client id, so every packet from a new client address was dropped with "no available client ids for new path" until the idle timeout. This affected clients using zero-length connection ids, such as Chrome, OpenSSL and msquic, on any change of address or port, including NAT rebinding. Now the zero-length client id is used on any path and is never retired, since RETIRE_CONNECTION_ID cannot be sent for it, see RFC 9000, 19.16. The problem appeared in c4f5b50c4 (1.25.0). --- diff --git a/src/event/quic/ngx_event_quic_connid.c b/src/event/quic/ngx_event_quic_connid.c index aac4f761c..11d814fee 100644 --- a/src/event/quic/ngx_event_quic_connid.c +++ b/src/event/quic/ngx_event_quic_connid.c @@ -344,7 +344,8 @@ ngx_quic_next_client_id(ngx_connection_t *c) { cid = ngx_queue_data(q, ngx_quic_client_id_t, queue); - if (!cid->used) { + if (!cid->used || cid->len == 0) { + /* a zero-length client id is used on all paths */ return cid; } } diff --git a/src/event/quic/ngx_event_quic_migration.c b/src/event/quic/ngx_event_quic_migration.c index bbb105142..e111ad474 100644 --- a/src/event/quic/ngx_event_quic_migration.c +++ b/src/event/quic/ngx_event_quic_migration.c @@ -416,9 +416,10 @@ ngx_quic_free_path(ngx_connection_t *c, ngx_quic_path_t *path) /* * invalidate CID that is no longer usable for any other path; - * this also requests new CIDs from client + * this also requests new CIDs from client; + * a zero-length CID is used on all paths and cannot be retired */ - if (path->cid) { + if (path->cid && path->cid->len) { if (ngx_quic_free_client_id(c, path->cid) != NGX_OK) { return NGX_ERROR; }