GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(web/world): snapshot/event sequence and participant ids accept negative, fractional and unsafe numbers — a malformed frame poisons the reconnect cursor (PR #4236 residual) · Issue #10401 · developing-today/code

id(web/world): snapshot/event sequence and participant ids accept negative, fractional and unsafe numbers — a malformed frame poisons the reconnect cursor (PR #4236 residual) #10401

New issue
Copy link
New issue
Copy link
Closed
#10403
Closed
id(web/world): snapshot/event sequence and participant ids accept negative, fractional and unsafe numbers — a malformed frame poisons the reconnect cursor (PR #4236 residual)#10401
#10403
Copy link
Assignees
dezren39
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/lowNice to have; do when convenientsource/pr-diff-reviewFiled by the pr-diff-review jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Nov 14, 2026
Issue body actions

Finding

PR #4236 added shape validation for world WebSocket snapshot/event frames in the web client, but the numeric fields are checked only for finiteness: current_sequence, event sequence, and participant id accept negative, fractional, and unsafe-integer values (e.g. -1, 1.5, 1e100). Those values are world-protocol u64s — the shell contract in the same repo bounds sequence as a u64 (see the #4238 tests) and PR #4250's collab validator requires Number.isSafeInteger(version) && version >= 0 for the analogous field — so a frame the Rust server could never legitimately send passes the web validator and poisons client state:

  • pkgs/id/web/src/world.ts (current main, fb124d8): isFiniteNumber at line 159; isWorldSnapshot (160–169) checks current_sequence and participant id with it; isWorldEvent (170–186) checks sequence and participant_id with it.
  • A snapshot with current_sequence: -1 (or 1.5) is accepted and assigned straight to the reconnect cursor (line 225: cursor = snapshot.current_sequence). On reconnect the join frame sends after: cursor || null (line 568) — a negative or fractional cursor goes on the wire verbatim as the resume position.
  • An event with sequence: 1e100 is accepted and cursor = Math.max(cursor, event.sequence) (line 245) raises the cursor past every real sequence: after a reconnect the client asks to resume after 1e+100, i.e. past the end of the world log.
  • A fractional participant_id never matches a rendered participant ([data-participant="1.5"]), so chat lines fall back to a bogus player 1.5 identity instead of the frame being rejected.

This is the same shape-trust class the repo has been closing frame-by-frame (#7908 records cursor, #7924 view/error frames, #7928 upload/compile fields, and #4250's INIT version check) — the snapshot/event numeric fields are the remaining gap in the validator #4236 introduced.

Evidence

  • Source PR: fix(id-web): validate world snapshot and event frames #4236 — fix(id-web): validate world snapshot and event frames #4236 (merge commit ee5f0d4f253a6e2069891e37d044a280424ca19a, confirmed ancestor of current main, compare status ahead). It implemented the Phase-3 fix for id(web): world WebSocket receive() trusts frame shape past the type tag — a parseable-but-wrong-shaped snapshot/event throws out of the handler and is dropped mid-processing #2802 (CLOSED) by adding isWorldSnapshot/isWorldEvent with isFiniteNumber checks; its tests cover missing/wrong-type/NaN fields but no negative, fractional, or >2^53 values.
  • Current main fb124d87f7c01523499635dfc4910dab92ad9f79, pkgs/id/web/src/world.ts lines 159–186, 225, 245, 568 — read directly from main this run; the validators are unchanged since fix(id-web): validate world snapshot and event frames #4236 apart from later sibling-frame checks (id(web/world): session-WS records frame shape-trusted — a string records renders per-character entries, a non-string next_after is echoed back as the pagination cursor #7908/id(web/world): session-WS invite, view and error frames shape-trusted — a non-string invite capability is persisted as '[object Object]', non-string view/error text renders coerced #7924) that did not touch these fields.
  • Contrast in the same batch: PR fix(id-web): validate collaboration MessagePack frames #4250 (pkgs/id/web/src/collab.ts) rejects an INIT version unless Number.isSafeInteger(version) && version >= 0; PR fix(id-web): validate shell contract field specs #4238's shell-contract validator enforces u64 bounds on sequence.

Why it matters

The validator's job (#2802) is that a parseable-but-wrong-shaped frame changes no state. Today a single malformed snapshot or event silently moves the resume cursor to a position the server never issued — negative, fractional, or past the end of the log — and the damage only appears later, at reconnect, as a join the server cannot honor or a resume that skips the world's history. Rejecting the frame at receipt (the established rejectFrame() discipline) keeps the failure visible and the cursor trustworthy.

Acceptance criteria

  • isWorldSnapshot/isWorldEvent reject negative, fractional, and unsafe-integer (>2^53) values for current_sequence, sequence, participant_id, and participant id — e.g. a shared safe-non-negative-integer check mirroring fix(id-web): validate collaboration MessagePack frames #4250's INIT version rule — with the frame rejected via the existing rejectFrame() path and no cursor/DOM state change.
  • Regression tests in the world-records/world validator suite deliver snapshot/event frames with -1, 1.5, and 1e100 sequence values (and a fractional participant id) and pin rejection plus an unchanged cursor (a subsequent reconnect join still sends the pre-frame after).
  • Valid frames at the u64-representable boundary the existing tests use (e.g. 2 ** 53 sequences in the shell-contract suite) keep their current accepted behavior where the contract allows it — no tightening beyond the wire type.

Found by pr-diff-review lane B reviewing PR #4236 against current main. Dedupe: issue searches (isWorldSnapshot, current_sequence, world snapshot sequence negative) returned the sibling shape-trust issues (#7831 open — host-view/invite HTTP responses; #7908, #7924, #7928 closed — records/view/invite/upload frames) and #2802 (closed, the parent #4236 implemented); none covers snapshot/event sequence or participant-id integrality.

Activity

  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/pr-diff-reviewFiled by the pr-diff-review job
    priority/lowNice to have; do when convenient
    on Nov 14, 2026
  2. developing-today commented on Nov 14, 2026

    @developing-today
    developing-todayBot
    on Nov 14, 2026 – with developing.today
    Contributor
    More actions

    CODE-3760

  3. dezren39
    added
    queue/queuedHas a queued queue task
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 14, 2026
  4. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    agent-note:v1
    Agent: pr-diff-review-b
    State: filed
    Repo: developing-today/code
    Source PR: #4236 (#4236, merged ee5f0d4); implements fix for #2802 (CLOSED)
    Finding: PR #4236's world web validators check snapshot/event numeric fields only for finiteness (pkgs/id/web/src/world.ts:159-186 on main): current_sequence, sequence and participant ids accept -1, 1.5 and 1e100, though they are protocol u64s; an accepted snapshot assigns the value to the reconnect cursor (:225, sent as join after at :568) and an event raises it via Math.max (:245), poisoning resume.
    Verified against main: fb124d8 (contents read of world.ts on main; PR #4236 merge confirmed ancestor, compare ahead). Contrast: PR #4250's collab INIT version requires Number.isSafeInteger && >= 0; PR #4238's shell contract bounds sequence as u64.
    Evidence: hidden_files/pr-review-b-2026-11-14-1718-code/issue-4236-sequence-body.md + diff-4236.patch + main-world.ts

  5. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    Agent note — picked up + triaged (task 17335, lane code-d)

    • State: triaged — claimed by lane code-d (queue task 17335); inline triage per runbook §1c, fix proceeds in the same session.
    • Work kind: small-fix (task/small-fix). Priority: priority/low (kept) — validation-consistency gap on a server-supplied frame path; legitimate server never sends such values, trigger is a faulty/hostile endpoint.
    • Effort: effort/xs — one shared safe-non-negative-integer check in pkgs/id/web/src/world.ts plus regression tests.
    • First concrete step: verify current world.ts validators on fresh main, add a shared isSafeNonNegativeInteger check mirroring PR fix(id-web): validate collaboration MessagePack frames #4250's collab INIT rule for current_sequence, sequence, participant_id, and participant id, routed through the existing rejectFrame() path.
    • Acceptance check: regression tests deliver -1, 1.5, and 1e100 sequence frames and a fractional participant id, pinning rejection and an unchanged reconnect cursor; existing pkgs/id/web suites keep passing with no tightening beyond the wire type.
  6. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    effort/xsTrivial: expected under 30 minutes of work
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 14, 2026
  7. github-actions
    assigned
    dezren39
    on Nov 14, 2026
  8. developing-today
    added
    status:in-review
    on Nov 14, 2026
  9. dezren39
    added a commit that references this issue on Nov 14, 2026

    fix(id/web): reject non-u64 world snapshot/event sequences and partic…

    66d8a31
  10. dezren39
    closed this as completedin #10403on Nov 14, 2026
  11. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 14, 2026
  12. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 14, 2026
  13. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    Agent note — done (task 17335, lane code-d)

    • Outcome: fixed_merged. PR fix(id/web): reject non-u64 world snapshot/event sequences and participant ids #10403 squash-merged as 66d8a31; this issue is CLOSED by the merge.
    • Fix: pkgs/id/web/src/world.ts — shared isSafeNonNegativeInteger check (safe integer >= 0, mirroring PR fix(id-web): validate collaboration MessagePack frames #4250's collab INIT rule) for snapshot current_sequence and participant id, and event sequence and participant_id, through the existing rejectFrame() path. No tightening beyond the wire type (input data / view revisions unchanged).
    • Tests: new world-sequence.test.ts 5/5 pass with the fix and 5/5 fail on unfixed main; full pkgs/id/web vitest suite 38 files / 821 passed / 9 skipped; tsc --noEmit clean. Codex review failed on usage limits with zero findings (dispositioned on PR fix(id/web): reject non-u64 world snapshot/event sequences and participant ids #10403).
  14. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    Agent note — duplicate fix packet already done (task 17338, lane code-d)

    • Task 17338 is the small_fix follow-on packet for this issue. The fix was already done in the same session under task 17335 (inline triage + fix per runbook §1c): PR fix(id/web): reject non-u64 world snapshot/event sequences and participant ids #10403 squash-merged 66d8a31 and this issue is CLOSED (fresh check this claim).
    • Completing task 17338 as already_done with that evidence; no second PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

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/lowNice to have; do when convenientsource/pr-diff-reviewFiled by the pr-diff-review jobstatus: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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.