Skip to content

RETIRE_CONNECTION_ID with invalid DestinationConnectionId #13

@WesleyRosenblum

Description

@WesleyRosenblum

While testing the Kwik client, Kwik sent a RETIRE_CONNECTION_ID frame with Sequence: 0, using the Destination Connection ID referred to by Sequence ID 0. This is prohibited by RFC 9000 §19.16:

The sequence number specified in a RETIRE_CONNECTION_ID frame MUST NOT refer to the Destination Connection ID field of the packet in which the frame is contained.

The invalid RETIRE_CONNECTION_ID frame was received in response to the server sending two NEW_CONNECTION_ID frames, each with Retire Prior To set to 1.

    QUIC Short Header DCID=551da9400f5df100 PKN=2
        Destination Connection ID: 551da9400f5df100
        Packet Number: 2
    NEW_CONNECTION_ID
        Frame Type: NEW_CONNECTION_ID (0x0000000000000018)
        Sequence: 1
        Retire Prior To: 1
        Connection ID Length: 16
        Connection ID: 5d85502aec55ed8353dadfeef312dcbd
        Stateless Reset Token: e269a195ef8062b70da779053a8fbc1c
    NEW_CONNECTION_ID
        Frame Type: NEW_CONNECTION_ID (0x0000000000000018)
        Sequence: 2
        Retire Prior To: 1
        Connection ID Length: 16
        Connection ID: c2d3ecf9baa79bcaab11be1110319b59
        Stateless Reset Token: b8c029034e90fddc9ee9444fa8d5c6cd

Kwik responds with:

    QUIC Short Header DCID=f056bb77e1f2a374733029cd0985f75d PKN=3
        Destination Connection ID: f056bb77e1f2a374733029cd0985f75d
        Packet Number: 3
    RETIRE_CONNECTION_ID
        Frame Type: RETIRE_CONNECTION_ID (0x0000000000000019)
        Sequence: 0

Since Destination Connection ID: f056bb77e1f2a374733029cd0985f75d is the connection ID referred to by Sequence: 0, this is not valid. The Destination Connection should be either 5d85502aec55ed8353dadfeef312dcbd or c2d3ecf9baa79bcaab11be1110319b59

I didn't see anything obviously wrong in the Kwik code, but perhaps there is a race condition where the connection ID is being retired and the RETIRE_CONNECTION_ID frame is sent before the currentConnectionId can be updated?

Thanks for considering this issue and let me know if you need any further information!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions