Skip to content

Client silently ignores preferred_address #2661

Duplicate

Description

@LiD0209

Client silently ignores preferred_address

Summary

Merged Redundant Reports

The following report had the same implementation cause and the same required fix, so it has been merged into this report and the redundant file was removed:

  • 501-1000/0010-preferred-address-unsupported.md

The shared cause is that the client-side preferred_address transport parameter branch is still a TODO: it does not parse or store the parameter, does not reject invalid zero-length CIDs, and does not integrate the supplied CID/token into connection-ID state. The shared fix is to implement full preferred_address parsing and validation, including TRANSPORT_PARAMETER_ERROR for invalid zero-length CIDs.

preferred_address is optional for a server to send, so the missing encode path
alone is not enough to prove a protocol bug. The demonstrated issue is on the
client receive path: quiche does not parse or store preferred_address,
silently accepts a zero-length CID that RFC 9000 requires it to reject, and
never integrates the transport-parameter CID into connection-ID state.

Standard Requirement

RFC 9000 Section 9.6: Server's Preferred Address

A server conveys a preferred address by including the
preferred_address transport parameter in the TLS handshake.

Servers MAY communicate a preferred address of each address family
(IPv4 and IPv6) to allow clients to pick the one most suited to their
network attachment.

This makes send-side support optional. A server that does not advertise
preferred_address is not automatically non-compliant.

RFC 9000 Section 18.2: Transport Parameter Definitions

The Connection ID and Stateless Reset Token fields of a preferred
address are identical in syntax and semantics to the corresponding
fields of a NEW_CONNECTION_ID frame (Section 19.15).  A server
that chooses a zero-length connection ID MUST NOT provide a
preferred address.  Similarly, a server MUST NOT include a zero-
length connection ID in this transport parameter.  A client MUST
treat a violation of these requirements as a connection error of
type TRANSPORT_PARAMETER_ERROR.

This is the key mandatory receive-side rule. Even if a client never migrates, it
must still reject an invalid preferred_address.

RFC 9000 Section 5.1.1: Issuing Connection IDs

If the preferred_address transport parameter is sent, the sequence
number of the supplied connection ID is 1.
...
This includes the connection ID issued by the server via the
preferred_address transport parameter.

RFC 9000 Section 18.2: Transport Parameter Definitions

This value includes the
connection ID received during the handshake, that received in the
preferred_address transport parameter, and those received in
NEW_CONNECTION_ID frames.

So the CID carried by preferred_address is not metadata to ignore; it has
explicit sequence-number and accounting semantics.

Relevant Source Code

quiche/src/transport_params.rs:155-194

pub struct TransportParams {
    ...
    pub unknown_params: Option<UnknownTransportParameters>,
    // pub preferred_address: ...,
}

TransportParams has no storage for a parsed preferred_address.

quiche/src/transport_params.rs:343-349,391

0x000d => {
    if is_server {
        return Err(Error::InvalidTransportParam);
    }

    // TODO: decode preferred_address
},
...
Ok(tp)

Server-only direction is enforced, but the client path does no parsing or
validation and still returns success.

quiche/src/transport_params.rs:524-530

if tp.disable_active_migration {
    TransportParams::encode_param(&mut b, 0x000c, 0)?;
}

// TODO: encode preferred_address

The missing encode path exists, but this is only a feature gap unless the
implementation intends to advertise preferred_address.

quiche/src/lib.rs:8094-8101

if !self.parsed_peer_transport_params && !raw_params.is_empty() {
    let peer_params = TransportParams::decode(
        raw_params,
        self.is_server,
        self.peer_transport_params_track_unknown,
    )?;

    self.parse_peer_transport_params(peer_params)?;
}

Handshake processing uses the same decode path above, so the TODO is on the
reachable client receive path.

quiche/src/lib.rs:8000-8004

// Record the max_active_conn_id parameter advertised by the peer.
self.ids
    .set_source_conn_id_limit(peer_params.active_conn_id_limit);

self.peer_transport_params = peer_params;

Only active_conn_id_limit is copied into CID management. There is no
preferred_address CID to register as sequence number 1 or to count toward the
limit.

Implementation Behavior

The implementation currently behaves as follows:

  • Client receives a server-sent preferred_address: accepted, but discarded.
  • Client receives a malformed preferred_address with zero-length CID:
    accepted, but discarded.
  • Server receives preferred_address from a client: rejected with
    InvalidTransportParam.

That means the required error mapping for invalid server-sent
preferred_address is missing on the client path.

Inconsistency Reason

The confirmed bug is narrower than "preferred_address is completely absent":

  • Optional send-side support is missing, but that alone is not enough.
  • Mandatory receive-side validation is missing, which is enough.

Because the parser has no preferred_address state and the reachable decode
branch is a no-op, quiche cannot enforce the RFC 9000 rule that a zero-length
CID inside preferred_address must trigger TRANSPORT_PARAMETER_ERROR. The
same missing state also prevents the supplied CID from participating in the
sequence-number and active_connection_id_limit semantics required by the RFC.

Runtime Evidence

Command used:

cargo test -p quiche transport_params_preferred_address_probe --lib -- --nocapture

Key result:

valid_client_recv=Ok(TransportParams { ... })
zero_len_cid_client_recv=Ok(TransportParams { ... })
server_recv=Err(InvalidTransportParam)

The client path silently ignores both valid and invalid server-sent
preferred_address. This directly contradicts
RFC 9000 Section 18.2.

Impact

  • A malformed preferred_address with zero-length CID is accepted instead of
    causing TRANSPORT_PARAMETER_ERROR.
  • A valid preferred_address is ignored, so the CID carried by the parameter
    never becomes usable migration state.
  • CID accounting derived from preferred_address cannot be enforced on this
    path because the CID is never parsed into transport-parameter state.

Fix Direction

  • Add a concrete preferred_address representation to TransportParams.
  • Parse Figure 22 exactly and reject invalid lengths or zero-length CID with
    InvalidTransportParam.
  • Register the supplied CID and stateless reset token with sequence number 1,
    using the same syntax/semantics as NEW_CONNECTION_ID.
  • Count the parsed CID toward the active_connection_id_limit logic.
  • Implement encode support only if the project wants to advertise preferred
    addresses.

Activity

  1. added
    type: feature
    area: migration
    on Nov 24, 2026
  2. ghedo commented on Nov 25, 2026

    @ghedo
    Member

    Closing as a duplicate of #828, which tracks client support for the server's preferred_address. #1634 proposes an implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: migrationtype: feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions