cloudflare / cloudflare/quiche

TLS QUIC Transport Parameter For Retry SCID

Open
#1,221 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
11.8k
Forks
1.1k
Avg merge
3d 7h
Merged PRs (30d)
16

Description

From [RFC 9000#7.3](https://datatracker.ietf.org/doc/html/rfc9000#section-7.3), the scenario is:

```
Client Server

Initial: DCID=S1, SCID=C1 ->
<- Retry: DCID=C1, SCID=S2
Initial: DCID=S2, SCID=C1 ->
<- Initial: DCID=C1, SCID=S3
...
```

The important point here is the fact that server changes `SCID` on its `INITIAL` after retry, (see `Initial: DCID=C1, SCID=S3`).

However, it seems the `HANDSHAKE` packet afterwards generated by the server does not correctly populate the quic transport parameter. In particular, the `retry_source_connection_id (0x10)`.

That field should contain the `SCID` used in the `RETRY` packet (from the example above would be `S2`).

Instead, in quiche code seems that field is always populated with the `SCID` build for the `INITIAL` packet (in the example would be `S3`): [here -today mainline commit-](https://github.com/cloudflare/quiche/blob/3628e4e6dfb1672085a8f8d668d8155795d74312/quiche/src/lib.rs#L1634-L1635).

---

If I am not wrong, this will make all handshakes fail because of [this check](https://github.com/cloudflare/quiche/blob/3628e4e6dfb1672085a8f8d668d8155795d74312/quiche/src/lib.rs#L1634-L1635) on the client side (which comes from the RFC9000#7.3).

The only workarounds I see (with possible drawbacks) are:
* Do not perform RETRY mechanism. This makes denial of service attacks easier tho.
* Do not change SCID during RETRY/INITIAL (that is having `S2 == S3`).
* Essentially, this is what has been made in the example of this repo [example/server.rs](https://github.com/cloudflare/quiche/blob/3628e4e6dfb1672085a8f8d668d8155795d74312/quiche/examples/server.rs#L252-L254).
* I am not sure if there are security implications into having `S2 == S3` and whether it's fine keeping the same connection id.

---

Is this a known limitation or am I missing something else?

Contributor guide

Open the contributing guide

Research direction

Start with quiche/src/lib.rs around lines 1634-1635 and compare the retry_source_connection_id handling with RFC 9000 section 7.3. Trace how the server's Retry and subsequent Initial connection IDs are represented, then verify the client-side check accepts the Retry SCID rather than the later Initial SCID.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.