Skip to content

fix(id): validate serve-proxy frame stream and sequence semantics #8951

Closed

Description

@dezren39

Evidence

pkgs/id/src/serve_proxy.rs documents Frame::stream_id as 0 only for leg-level frame types (for example PING and RESUME), and Frame::seq as a DATA-only sequence number that is 0 for other types (lines 32–36). However, Frame::validate currently checks only payload and total frame sizes (lines 98–112). As a result, Frame::new(FrameType::Data, 0, 0, vec![]) succeeds, and Frame::decode_prefix accepts the same invalid values from the wire because it calls that same validator (lines 141–149). The generic serve-proxy implementation issue #7569 is closed; the open design issue #5792 does not specifically track this validation gap.

Why it matters

Malformed peers or local callers can create frames whose stream/leg scope and sequencing contradict the documented wire contract. Downstream multiplexing and stream state handling then have to interpret invalid control/data frames inconsistently instead of rejecting them at the codec boundary.

Acceptance criteria

  • Define/enforce the allowed stream-ID and sequence-number combinations for each frame type according to the serve-proxy protocol decision; do not assume every frame is stream-scoped.
  • Reject invalid combinations through both Frame::new/encode and Frame::decode_prefix.
  • Add regression tests for DATA on stream 0, a non-DATA frame with nonzero sequence, and valid leg-level and stream-level frames.
  • Keep existing size-cap and incremental-decoder behavior unchanged.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/xsTrivial: expected under 30 minutes of work
    on Nov 12, 2026
  2. developing-today commented on Nov 12, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 12, 2026

    @dezren39
    MemberAuthor

    Fresh check on 2026-11-12: PR #8971 remains OPEN/UNSTABLE at 74ea286. Required checks fail in mcpx-test unit/ci-ok and E2E shards 0, 3, 4, 5, plus fleet-search parity (#5920); focused ID checks pass. This is shared CI blockage (mcpx failures tracked by #8900; parity by #8306), not evidence of a defect in this change. Leaving the Drew-authored PR untouched and unmerged pending required checks.

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

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus/blockedQueue or user escalation statestatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions