Skip to content

serve_tests web/iroh world test: forged join not refused with "join denied" (pre-existing, hidden by suite-B compile break) #9274

Closed

Description

@dezren39

serve_tests world-module web/iroh presentation test fails: forged join is not refused with "join denied"

Found during the pkgs/id crate split (step 6c, #4409) — NOT a split regression.

What

cargo test -p id --features web,ssh --test cli_integration serve_tests::test_world_module_shared_over_iroh_and_web_presentations fails at tests/cli_integration.rs:2800:

assertion failed: String::from_utf8_lossy(&forged.stdout).contains("join denied")

The test serves a world module over both iroh and web presentations, joins legitimately, then attempts a forged join, which the world session layer should refuse by sending the frame error join denied (crates/id-worlds/src/world_session/mod.rs, send_error(..., "join denied")). The forged client's stdout does not contain it.

Why it went unnoticed

This test only runs in the web,ssh feature configuration ("suite B"), which did not compile on main from step 5 of the crate split (#4408) until step 6c (#4409) repaired the web seam visibility. The Nix package checks skip serve_tests entirely (checkFlags = ["--skip", "serve_tests"] in pkgs/id/flake.nix, because they need networking the sandbox lacks). So no lane has executed this test in that window.

Proof it predates the 6c extraction

A/B: pristine main at 0e68fb4a (the step-6b merge) plus ONLY the mechanical visibility widenings needed to make suite B compile, with the web layer in its original src/web layout, fails the same test in the same way (4.1s, same assertion). The 6c diff does not touch the join/session logic; its id-worlds changes are visibility keywords and the test-utils feature gate.

Observed environment notes

  • Server stderr during the test shows one warning: serve: app discovery failed error=apps: No such file or directory (os error 2) — possibly related (the test environment has no apps directory), possibly benign.
  • The id-worlds unit tests asserting the same join denied refusal (crates/id-worlds/src/world_session/tests.rs) pass.

Acceptance

  • The test passes under cargo test -p id --features web,ssh, or is shown to be environment-bound and is gated with the same explicitness the Nix checks use, with the reason recorded here.

Activity

  1. developing-today commented on Nov 13, 2026

    @developing-today
    Contributor
  2. added
    task/ci-investigationQueue packet kind: investigate a CI failure
    priority/highImportant and time-sensitive
    effort/mMedium: expected under 1 day of work
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 17, 2026
  3. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged

    • Agent: repo-queue-worker-shift (lane any-d)
    • Session / ID: task 18926 (repo-health-code-pilot)
    • Outcome: Triaged — live, unlabeled-until-now test-failure investigation; ci-investigation follow-on enqueued as task 20375 at priority 20.

    Triage verdict: work kind ci-investigation, priority/high (ID program, priorities brief line 2; the missing refusal is authorization-adjacent until proven environmental), effort/m, kind/bug. Labels applied: task/ci-investigation, priority/high, effort/m, kind/bug (the issue carried no labels at all).

    Fresh evidence (2026-11-17): issue #9274 OPEN, no hard stops, sole prior comment is a Kaneo link. Both sides of the failure still exist on current main (ab7269d): the test at pkgs/id/tests/cli_integration.rs:2662 and the refusal in pkgs/id/crates/id-worlds/src/world_session/mod.rs (send_error(..., "join denied") lines 1123/1127). The issue's own A/B proof stands unrebutted: pre-existing, not a crate-split regression; session-layer unit tests pass; no CI surface runs this suite-B test (Nix checks skip serve_tests).

    First concrete step for task 20375: reproduce on the laptop under cargo test -p id --features web,ssh, then trace why the forged join escapes the refusal over the presentation path. Acceptance check: the test passes, or the test is gated with Nix-check-level explicitness and the environment-bound reason recorded here; if the forged join actually joins, the fix is treated as a security defect and stated plainly.

  4. added
    status/triagedTriaged and routed (see agent note)
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 17, 2026
  5. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Task 20375 (ci_investigation) — fixed and merged: PR #10998, merge sha ebfbd0b. Issue closed by the merge.

    Root cause was client-side, not the server: id world join's pump (pkgs/id/crates/id-cli/src/commands/world.rs) broke on stdin EOF and aborted its reader task. The forged join runs with stdin closed, so EOF fired immediately after the join frame was sent and the pump exited before the server's "join denied" error frame could be read and printed — stdout came back without the refusal. The server side was verified sound: world_session sends send_error(..., "join denied") on the participant/snapshot failure paths, and the id-worlds unit tests for the same refusal pass.

    Fix: the reader task now flags when a server frame has been printed; EOF keeps its existing leave-the-session behavior once any frame has printed, but EOF before the first frame disables the stdin arm and lets the reader arm end the pump when the stream closes — a refusal closes the stream right after its error frame, so the refusal prints first.

    Verification (laptop, worktree from main 40094420c3):

    • Reproduced on unmodified main: the issue's exact command failed at cli_integration.rs:2800 (stdout lacked "join denied").
    • With the fix, the same command passes.
    • Regression: cargo test -p id-cli green; full serve_tests:: module in cli_integration — 51 passed, 0 failed.
    • Codex and CodeRabbit were both quota-walled on the PR (usage-limit notices only, no findings).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

effort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivequeue/queuedHas a queued queue taskstatus/triagedTriaged and routed (see agent note)status:donetask/ci-investigationQueue packet kind: investigate a CI failure

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions