{"id":"XE-16942","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"687","source_url":"https://github.com/xeprotocol/xe/issues/687","reporter_id":2920,"title":"[Low] Gossip validators accept + relay blocks/votes with unknown JSON fields that every subscriber silently drops","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":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-17T07:54:35.716902+00:00","updated_at":"2026-11-22T23:26:12.139313+00:00","source_created_at":"2026-11-17T07:54:12+00:00","told_at":"2026-11-22T23:26:12.172611+00:00","status_changed_at":"2026-11-22T23:26:12.152563+00:00","url":"https://bounty.xe.network/XE-16942","body":"## Summary\n\nGossip validators decode Block/Vote messages with plain `json.Unmarshal` (unknown fields ignored), while the `Subscribe` paths decode with `DisallowUnknownFields()`. A valid block/vote (correct hash, valid signature/PoW) carrying one extra JSON field is therefore **accepted and relayed by every node but processed by none** — silent relay-without-processing, plus mesh bandwidth waste and a forward-compatibility trap.\n\n## Root Cause\n\n- `blockValidator` (`net/gossip_validate.go:63-66`) and `voteValidator` (`:106-109`) decode with plain `json.Unmarshal(msg.Data, &bm)` / `&vm` — unknown fields are ignored, so a tainted-but-valid message passes validation and is relayed.\n- The Block `Subscribe` path (`net/gossip.go:139-141`) and Vote `Subscribe` path (`:209-211`) decode with `dec.DisallowUnknownFields()` — the same message fails decoding and is silently dropped (`continue` after a warn log).\n- The other four topics (statechain, marketplace, directory, certificate) use plain unmarshal on **both** sides (`net/gossip.go:348, 444, 502`) and are unaffected — only Block/Vote diverge.\n\n## Impact\n\n- **Silent relay-without-processing:** a tainted block/vote propagates mesh-wide, consuming relay bandwidth (up to `MaxGossipMessageSize = 262144` bytes/message, `net/gossip.go:27`, × fanout) while contributing nothing, and earning the sender peer-score for messages no one processes.\n- **Vote suppression (weak angle):** a relay can append a junk field to someone else's vote without invalidating its signature (the signature covers the signing bytes, not the JSON envelope). Exploiting this for suppression needs eclipse-level positioning, so this angle is weak.\n- **Forward-compatibility trap (strongest angle):** any future protocol extension that adds a field to Block/Vote JSON would silently break gossip ingestion network-wide — old nodes would relay the new messages but drop them on subscribe — instead of failing cleanly at validation.\n\nSeverity Low: no crash, corruption, or fund loss.\n\n## Verification\n\nExecuted in-package test (valid block/vote with one extra field injected textually — a `map[string]any` round-trip would corrupt int64 timestamps and break the hash/signature):\n\n```\ntainted: validator=Accept, strict decode error=json: unknown field \"future_extension_field\"\n```\n\nLogged for both the block and the vote case; plain (untainted) controls are accepted by both paths.\n\n## Note on related reports\n\nSearched \"DisallowUnknownFields\" (0 hits) and \"gossip validator unknown fields\" (0 hits). #552/#394 report the same *symptom* (validator Accepts, Subscribe silently drops) but a **different mechanism** — the `len(b.Signature) != 128` check dropping multisig blocks — not the decode-strictness divergence reported here.\n\n## Suggested fix\n\nMatch decode strictness on both sides: add `DisallowUnknownFields()` to the validators (fail tainted messages at validation, with peer-score consequences), or drop it from the subscribers.\n","patch_refs":[],"thread":[{"id":18805,"source":"desk","source_ref":"reply:16482","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-16942 and says what differs; it is read like any other.","created_at":"2026-11-22T23:26:12.139313+00:00"}]}