noq-proto: no CONNECTION_CLOSE for a rejected ClientHello that spans two Initials

Open Beginner friendly
#892 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
networking

Research direction

Start by reading handle_packet and the alpn_mismatch_with_two_packet_hello test named in the issue. Run that test on the current code, then verify the rejected two-Initial ClientHello case sends CONNECTION_CLOSE while respecting the anti-amplification limit.

Written by the indexing model from the issue text.

Description

When a ClientHello spans two Initial packets and the server rejects it (ALPN mismatch, unknown server name), the server never sends CONNECTION_CLOSE. The client gets no TLS alert and hangs until its idle timeout. A ClientHello that fits in one Initial gets the close as expected.

We hit this with a long ALPN list, and with an X25519MLKEM768 key share, which makes the ClientHello too big for one Initial.

handle_packet only schedules the close when p.data.validated. When the second Initial arrives, the client address is not validated yet, so the close is dropped.

This is not #719: there the close is sent and the client does not act on it; here nothing is sent.

Test and fix: outpostHQ/noq@6b84c72de86bd038643d35a7becb452d249c9891. alpn_mismatch_with_two_packet_hello fails on main (bb9a5edca) and passes with the fix, which lets the packet that closed the connection schedule the close on an unvalidated path. The anti-amplification limit still bounds that send.

Happy to open a PR with it.

Dominant language
Rust
Stars
454
Forks
98
Avg merge
2d 8h
Merged PRs (30d)
19

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from n0-computer/noq

All issues in n0-computer/noq

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.