{"id":"XE-13208","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":2305,"title":"net: gossip validators accept unknown JSON fields that subscribers strictly reject — valid votes/blocks are propagated mesh-wide but never ingested","area":"p2p-sync","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T19:46:47.328699+00:00","updated_at":"2026-11-20T19:45:53.444455+00:00","source_created_at":null,"told_at":"2026-11-20T19:45:53.472538+00:00","status_changed_at":"2026-11-20T19:45:53.454257+00:00","url":"https://bounty.xe.network/XE-13208","body":"## Summary\n\nBlock and vote gossip topics decode the same wire bytes two different ways.\nThe topic validators use plain `json.Unmarshal` (unknown fields ignored);\nthe `Subscribe` loops use a `json.Decoder` with `DisallowUnknownFields`\n(unknown fields rejected). A vote or block carrying one extra JSON field\nwith an otherwise-valid signature/hash therefore passes its topic\nvalidator — `ValidationAccept`, forwarded mesh-wide — but is dropped by\nevery node's `Subscribe` loop with a `Warnf`, never reaching\n`VoteManager`/ledger. The other four topics do not diverge: StateChain,\nDirectory, and Certificate subscribers use plain `Unmarshal`, matching\ntheir validators; only Block and Vote are strict on subscribe.\n\n- Validators: `net/gossip_validate.go:66` (`blockValidator`) and `:103`\n  (`voteValidator`) — plain `json.Unmarshal`, then hash/PoW (block) and\n  signature (vote) checks, then `ValidationAccept`.\n- Subscribers: `net/gossip.go:139-145` (`Gossip.Subscribe`) and `:209-216`\n  (`VoteGossip.Subscribe`) — `json.NewDecoder` +\n  `dec.DisallowUnknownFields()`; decode error → `Warnf(... unmarshal\n  error ...)` → `continue` (message dropped).\n\n## Reproduction (xe @ 89a542e, real loopback libp2p hosts)\n\nCodec level (`TestR8ValidatorSubscriberDivergence`,\n`zz_r8_units_test.go`): byte-surgery injection appending one extra field\nto a marshalled `VoteMsg`/`BlockMsg`, preserving the signed bytes\nexactly — validator-style unmarshal accepts, subscriber-style strict\ndecode rejects with `json: unknown field \"future_field\"`, for BOTH vote\nand block.\n\nLive mesh (`TestR8GossipUnknownFieldLive`, `zz_r8_gossip_test.go`):\n2-node real pubsub mesh; attacker publishes a validly-signed vote with\none extra field; victim runs the real `VoteGossip.Subscribe` loop.\nObserved: the victim logged `vote gossip unmarshal error: json: unknown\nfield \"future_field\"` (delivery to the subscriber proves the validator\nAccepted it — gossipsub does not deliver rejected messages), the weird\nvote was never ingested, the clean control vote was delivered, and a\ngarbage/oversized burst caused no panic/wedge. Full harness run 20/20\nPASS (`~/workspace/work/xe-hunt-r8/full-run.log`).\n\n## Impact\n\nTwo consequences, stated with their bounds. (a) Forward-compat break:\nany future client version emitting a new field has its votes/blocks\npropagated-but-never-ingested network-wide — the producer sees gossip\nacceptance while zero nodes ingest. No producer emits unknown fields\ntoday, so this bites on version skew, not on the current network; no\nconsensus split is claimed (the drop is uniform across nodes). (b)\nLog-spam vector: a modified client can emit valid-signature\nunknown-field votes that every node `Warnf`-logs (no PoW on votes);\nvolume is bounded by the rotating writer's size/file caps, and the\nper-message verify cost is the one XE-8347 already claims — disclosed\nso triage can weigh it. Minor: a proven codec divergence with a\none-line-class fix, whose worst case is silent network-wide vote/block\nloss during an upgrade.\n\n## Duplicate check (queries re-run 15 Nov 2026; neighbour bodies read)\n\n- `DisallowUnknownFields` (1 hit): XE-11788 — statechain sync nil-block\n  dereference crash, body read; different subsystem, different mechanism\n  (nil deref, not unknown-field divergence).\n- `unknown field` (1 hit): XE-1968 — `ValidateGenesis` never calls\n  `ValidateOp`; genesis validation, unrelated (title-level).\n- `forward compat` (0 hits). `unknown-field`/`strict decod` wordings\n  covered by the above; no ticket names the validator/subscriber\n  divergence.\n- Family: XE-8347 (vote flood, body read in full in R8) claims\n  verify-cost flooding by valid-signature votes — a distinct mechanism\n  from this codec divergence; the log-spam overlap is disclosed above.\n  XE-2620 (`enqueueVote`) is a different drop path. Nothing title-only\n  except XE-1968, whose title rules it out.\n\n## Suggested fix\n\nMake validators and subscribers agree on unknown fields — either\nstrict-decode in the validators (Reject unknown fields, with score\npenalty, so bad messages are not forwarded) or drop\n`DisallowUnknownFields` in the two `Subscribe` loops (so\nvalidator-accepted messages are ingestible). Either direction closes\nthe propagated-but-never-ingested gap.","patch_refs":[],"thread":[{"id":15304,"source":"desk","source_ref":"reply:13195","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-13208 and says what differs; it is read like any other.","created_at":"2026-11-20T19:45:53.444455+00:00"}]}