Skip to content

fix(net): reject invalid Lite SETUP on release - #5661

Merged
kixelated merged 3 commits into
releasefrom
quest/m1/lite-setup-backport
Oct 16, 2026
Merged

kixelated merged 3 commits into
releasefrom
quest/m1/lite-setup-backport

Conversation

@kixelated

@kixelated kixelated commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

On release, a moq-lite peer that repeats a SETUP Parameter ID or opens a second Setup Stream does not get the session closed (#5521). UniServe aborts a SETUP that fails to decode and returns Ok, and PeerSetup::set silently overwrites a second SETUP. The draft requires PROTOCOL_VIOLATION for both.

Approach

Ports only the two closes from #4704 (already on main):

  • PeerSetup::claim claims the Setup Stream as soon as its type is read, so a second stream (even while the first body is incomplete) is a violation.
  • A claimed SETUP that fails to decode closes the session with PROTOCOL_VIOLATION, since nothing else can satisfy the slot.

setup.rs matches #4704 exactly; subscriber.rs matches its claim and close hunks.

Tests:

  • lite::session::tests::repeated_setup_parameter_closes_the_session: SETUP read through UniServe (the client path the issue reports). Fails without the fix.
  • server::tests::accepted_lite_setup_refuses_a_second_setup_stream: fails without the fix.
  • server::tests::repeated_lite_setup_parameter_closes_the_session: the server accept_setup path, which already closed on release; kept as coverage.

Impact

  • Public API: none.
  • Wire: no framing change; enforces the existing requirement to close invalid Lite SETUP with PROTOCOL_VIOLATION.

Alternatives

Backporting all of #4704 (early-stream retention) and #5550 (control violation closes, transport binding) was rejected: #5550 breaks the transport API, and neither is needed for #5521.

Follow-ups

  • The JS release implementation has the same session-close gap; main fixed it in fix(net): enforce Lite control stream rules #5550. Not backported here.
  • main has no repeated-Parameter-ID test yet, and quest/m1/lite-setup-backport.md needs deleting there.
  • Closes #5521 does not fire on a non-default base; close it by hand once this merges.

Closes #5521

(Written by GPT-5.4, revised by Claude Opus 5.5)

kixelated and others added 3 commits October 15, 2026 19:54
The server accept test already passed on release without the fix, since
accept_setup maps a decode error to ProtocolViolation. This one reads the
SETUP through UniServe, the client path #5521 reports, and fails without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review October 16, 2026 04:34
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T04:35:51.872259Z 6a089f2 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary:

(Written by Opus 5.5)

@kixelated
kixelated merged commit 5d114d7 into release Oct 16, 2026
7 checks passed
@kixelated
kixelated deleted the quest/m1/lite-setup-backport branch October 16, 2026 05:17
@moq-bot moq-bot Bot mentioned this pull request Oct 16, 2026
kixelated added a commit that referenced this pull request Oct 16, 2026
main already closes the session with PROTOCOL_VIOLATION when a SETUP
repeats a Parameter ID, but nothing tested it. Extend the Rust truncated
SETUP test into a table with the repeated-parameter case, and add the
matching js/net test. Both fail without the close.

The release backport landed in #5661, so the quest is done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@moq-bot moq-bot Bot mentioned this pull request Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant