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(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted · Issue #6499 · developing-today/code

id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499

New issue
Copy link
New issue
Copy link
Closed
#7627
Closed
id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted#6499
#7627
Copy link
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

Problem

parse_wants (pkgs/id/crates/id-core/src/world_caps.rs:733) parses a world program's wants document into a serde_json::Value first (:738) and only then runs its checks against the collapsed map:

  • the format-version check reads object.get("v") (:742-747),
  • the subscription entry cap reads object.get("subscribe") and checks the surviving array's length against MAX_WANTS_ENTRIES (:749-756),
  • the request checks read object.get("requests") and, per entry, entry.get("id") / entry.get("cap") with the MAX_NAME_BYTES and control-character rules (:764-790).

serde_json::Value keeps only the last value of a repeated object key, so every one of those checks can be defeated by putting the forbidden value first and a benign duplicate after it. The document the host validates is not the document the program wrote: two readers of the same bytes (this parser vs. any strict reader, a logger, or a human) disagree about what was asked for.

Evidence (verified this run, laptop, real id-core crate, origin/main b7a15d7; world_caps.rs identical HEAD..origin)

Probe ~/git/fleet/probe-wants-dup (path-dep on the real id-core), calling parse_wants directly:

Controls — each forbidden value standalone is refused, as designed:

  • {"v":99} → Err (unsupported version)
  • a request whose cap is 65 bytes (> MAX_NAME_BYTES 64) → Err
  • a request whose id contains a control character → Err
  • a subscribe array with 65 entries (> MAX_WANTS_ENTRIES 64) → Err
  • a benign wants document → Ok

Findings — the same forbidden values hidden behind a benign duplicate key all parse Ok:

  • {"v":99,"v":1} → Ok (version 99 never seen by the version check)
  • {"requests":[{"id":"r1","cap":"<65 bytes>","cap":"ok"}]} → Ok (over-long cap hidden inside the entry object)
  • {"requests":[{"id":"a<CTRL>b","id":"ok","cap":"x"}]} → Ok (control-character id hidden inside the entry object)
  • {"subscribe":[<65 entries>],"subscribe":["players"]} → Ok (over-cap subscription list hidden at the top level)
  • {"requests":[{"id":"r1","cap":"<65 bytes>"}],"requests":[]} → Ok (a whole non-conforming requests array hidden at the top level)

Why it matters

wants is host-parsed, program-supplied input: the checks in parse_wants are the host's schema and bounds enforcement for what a world program may ask for (its own doc comment: "The caller treats that as a program failure, like invalid records"). A parser that validates a different document than the one on the wire is the same defect class already filed for the sibling Value-first parsers — #6473 (parse_records), #6474 (world fixture decode), #6491 (parse_surface) — and the fix pattern is established there: detect duplicate keys before/at parse (a duplicate-recording visitor or a strict typed decode), never validate the collapsed map. parse_wants is the remaining Value-first parser in id-core with checked fields; args values are opaque payloads and are out of scope except that their container keys (id/cap) are checked fields.

Acceptance criteria

  • parse_wants refuses any document with a duplicate object key in a checked position: the top-level object (v, subscribe, requests) and each request entry object (id, cap, args), naming the repeated key.
  • Each probe form above is refused; the standalone controls stay refused; benign documents (including documents whose args payloads legitimately repeat nothing) parse exactly as today.
  • Regression tests pin: duplicate v (bad-first and bad-last), duplicate request cap over MAX_NAME_BYTES, duplicate request id with a control character, duplicate top-level subscribe over MAX_WANTS_ENTRIES, duplicate top-level requests.
  • No change to the accepted-document semantics: field order, optional v, unknown top-level keys, and args contents behave as before for duplicate-free documents.

Activity

Next
  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
    on Nov 6, 2026
  2. developing-today commented on Nov 6, 2026

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

    CODE-1961

  3. dezren39
    added
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 6, 2026
  4. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator (new-issue-creator-code-a)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-11-06 04:05 CST
    • Found via: filed this run
    • Task: parse_wants (pkgs/id/crates/id-core/src/world_caps.rs:733) validates a serde_json::Value-collapsed map, so duplicate JSON keys hide a forbidden version/cap/id/list-size from every check — verified with probe ~/git/fleet/probe-wants-dup against the real id-core crate (5 controls refused standalone, 5 duplicate-hidden forms accepted). Sibling class of id(world): parse_records silently collapses duplicate JSON keys — an oversized value hidden behind a duplicate passes MAX_RECORD_VALUE_BYTES, and the record-count cap is checked after collapse #6473/id(world_fixture): decode accepts duplicate JSON fields in header and event lines — check_keys and the window check only ever see the collapsed last value #6474/id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted #6491 in the remaining Value-first parser.
    • Expectation: effort s — triage via the enqueued repo-task/v1 packet; done when parse_wants refuses duplicate keys in checked positions with regression tests, per the issue's acceptance criteria.
    • Links: packet packet-6499-triage.json (hidden_files)
  5. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed (dup-enqueue flag)

    • Agent: new-issue-creator (new-issue-creator-code-a)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-11-06 04:05 CST
    • Found via: filed this run
    • Task: Enqueue was invoked twice for this issue: the first invocation returned a task record whose id was cut off in my captured output; the second reported "enqueued new task 10986". Canonical task for this issue is task 10986. If a second queued task exists with dedupe_key repo-health:v1:triage:developing-today/code:issue:6499, it is a duplicate of task 10986 and should be cancelled as such (fleet monitor reconciliation).
    • Expectation: effort s — no action needed beyond the dedupe note; triage proceeds on task 10986.
    • Links: task 10986; packet packet-6499-triage.json
  6. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-e
    • Session / ID: task 10986
    • Found via: queue claim
    • Task: Handed off task 10986 (triage) for issue id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499 to the opencode claimant — execution lane assigned opencode. Fresh check: issue id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499 OPEN, no hard-stop labels.
    • Expectation: claimant launches the bound opencode session and drives task 10986 to a terminal state
    • Links: issue id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499
  7. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-a
    • Session / ID: task 10986
    • Found via: queue claim
    • Task: Handing task 10986 (triage) for issue id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499 to the opencode claimant — execution lane assigned opencode (§1b). Fresh check: issue id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499 OPEN, no hard-stop labels.
    • Expectation: claimant launches a bound session; task 10986 parked 20 minutes for the claimant launch window. Attempts 3/4.
    • Links: issue id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499 id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499
  8. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 6, 2026
  9. 27 remaining items

  10. dezren39
    added
    queue/queuedHas a queued queue task
    status/needs-triageNot yet triaged; needs a first look
    and removed
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 7, 2026
  11. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: fleet monitor
    • Session / ID: task 10986
    • Found via: monitor reconciliation
    • Task: Claim evaporated — task 10986 is queued unclaimed (attempts 1) while the issue carried claimed/parked labels. Labels reset to queue/queued + status/needs-triage so the next claim starts from the truth.
    • Expectation: s — re-claim and work from the checkpoint stage named in the task progress, if any.
    • Links: task 10986
  12. developing-today
    added
    status:in-review
    on Nov 8, 2026
  13. dezren39
    added a commit that references this issue on Nov 8, 2026

    Merge pull request #7627 from developing-today/creator-a/6499-wants-d…

    79ee7f3
  14. dezren39
    closed this as completedin #7627on Nov 8, 2026
  15. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 8, 2026
  16. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: new-issue-creator (new-issue-creator-code-a)
    • Session / ID: cron new-issue-creator-code-a run 2026-11-08T09:57Z (remediation pass, same run)
    • Found via: filed this run — as the duplicate id(world_caps): parse_wants validates a last-wins collapse — duplicate keys bypass the version check and the 64-entry bounds (residual door of #6501/#6520) #7621 (see below); completing the canonical issue here
    • Task: this issue is COMPLETE. The fix it asks for landed in PR fix(id): parse_wants refuses duplicate JSON keys (#7621) #7623 (merge 165b652): parse_wants now parses through parse_json_without_duplicate_keys, so a duplicate key at any depth is refused with the repeated key named in the error — covering every checked position this issue lists (top-level v/subscribe/requests, per-entry id/cap/args, and deeper). The three acceptance pins this issue names that id(world_caps): parse_wants validates a last-wins collapse — duplicate keys bypass the version check and the 64-entry bounds (residual door of #6501/#6520) #7621's test did not already cover (over-MAX_NAME_BYTES cap hidden behind a duplicate, control-character id hidden behind a duplicate, a whole non-conforming requests array hidden behind a duplicate top-level key) were added by PR test(id): pin the #6499 duplicate-key forms for parse_wants #7627 (merge 79ee7f3), and rejects_duplicate_keys_at_any_depth is verified green on merged main (79ee7f3). Duplicate-free semantics are unchanged (full id-core suite: 329 passed on the fix branch).
    • Dedup record: id(world_caps): parse_wants validates a last-wins collapse — duplicate keys bypass the version check and the 64-entry bounds (residual door of #6501/#6520) #7621 is a duplicate of this issue, filed by this same run — the run's dedup search naming id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499 completed after id(world_caps): parse_wants validates a last-wins collapse — duplicate keys bypass the version check and the 64-entry bounds (residual door of #6501/#6520) #7621 had been filed and its self-solve was under way. id(world_caps): parse_wants validates a last-wins collapse — duplicate keys bypass the version check and the 64-entry bounds (residual door of #6501/#6520) #7621 stays closed as the duplicate; this issue is the canonical record and is closed by the two PRs above.
    • Queue disposition: this issue carried queue/queued; it is now closed and the fix is merged, so the queued packet for it has no remaining work — closing it out per the lifecycle protocol's finished-state rule (labels cleaned in the same pass).
    • Expectation: met
    • Links: PR fix(id): parse_wants refuses duplicate JSON keys (#7621) #7623 · PR test(id): pin the #6499 duplicate-key forms for parse_wants #7627 · duplicate id(world_caps): parse_wants validates a last-wins collapse — duplicate keys bypass the version check and the 64-entry bounds (residual door of #6501/#6520) #7621
  17. dezren39
    removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 8, 2026
  18. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    MemberAuthor
    More actions

    🤖 Agent note · queue reconciliation

    • Agent: repo-worker-code, lane aea12c82-c5af-4e5a-9b66-f8e360f87177
    • Session / task: ses_e5e3773651effepqMyGXQRWV0D / 10986
    • Found via: queue claim, origin checkpoint recorded.
    • Disposition: issue is already closed completed with status:done; prior completion note identifies fix PR fix(id): parse_wants refuses duplicate JSON keys (#7621) #7623 and regression PR test(id): pin the #6499 duplicate-key forms for parse_wants #7627, both merged. This stale triage packet has no remaining work and will be completed; existing done labels remain unchanged.
    • Verification: GitHub issue state and completion note checked 2026-11-11 UTC; no code or tests changed in this reconciliation.
  19. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    MemberAuthor
    More actions

    Verified already fixed — no new work needed from queue task 14847:

    • parse_wants on current main (pkgs/id/crates/id-core/src/world_caps.rs) parses through crate::json_unique::parse_json_without_duplicate_keys — the Design: a duplicate key is a parse error — one duplicate-key refusal contract for pkgs/id's checked JSON gates #6520 rule — with the comment naming exactly this hazard: the version check and entry bounds see the document as written, never a last-wins collapse.
    • PR test(id): pin the #6499 duplicate-key forms for parse_wants #7627 (MERGED) pinned the id(world_caps): parse_wants collapses duplicate JSON keys before its checks — a forbidden version, cap, id, or list size hidden behind a duplicate is accepted #6499 duplicate-key forms for parse_wants as regression tests.
    • This issue is closed with status:done, consistent with that landing.

    Closing the queue task as already-done; no PR opened.


    🤖 agent-note:v1 — queue task 14847 (lane code-g), verified-already-fixed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    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.