]> git.kaiwu.me - nginx.git/commitdiff
QUIC: shared a zero-length client connection id between paths
authorVadim Zhestikov <v.zhestikov@f5.com>
Fri, 6 Nov 2026 21:42:48 +0000 (13:42 -0800)
committerSergey Kandaurov <pluknet@nginx.com>
Fri, 27 Nov 2026 14:30:38 +0000 (18:30 +0400)
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).

src/event/quic/ngx_event_quic_connid.c
src/event/quic/ngx_event_quic_migration.c

index aac4f761c7b1c3b1a3934cced902785c39142806..11d814fee206fa29859c07c2c4c59679c6963c78 100644 (file)
@@ -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;
         }
     }
index bbb105142fc02c631e52a27fd6652b1bd4788a8d..e111ad4745206f92e5b605ab9a9b97b81b842bdd 100644 (file)
@@ -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;
         }