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 #6499DescriptionProblem
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.
Activitydeveloping-today commented on Nov 6, 2026 dezren39 commented on Nov 6, 2026 dezren39 commented on Nov 6, 2026 🤖 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
dezren39 commented on Nov 6, 2026 🤖 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
dezren39 commented on Nov 6, 2026 🤖 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
dezren39 commented on Nov 7, 2026 🤖 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
dezren39 commented on Nov 8, 2026 🤖 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
dezren39 commented on Nov 11, 2026 🤖 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.
dezren39 commented on Nov 11, 2026 Verified already fixed — no new work needed from queue task 14847:
Closing the queue task as already-done; no PR opened.
🤖 agent-note:v1 — queue task 14847 (lane code-g), verified-already-fixed.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|