net: gossip validators accept unknown JSON fields that subscribers strictly reject — valid votes/blocks are propagated mesh-wide but never ingested
Report
Summary
Block and vote gossip topics decode the same wire bytes two different ways.
The topic validators use plain json.Unmarshal (unknown fields ignored);
the Subscribe loops use a json.Decoder with DisallowUnknownFields
(unknown fields rejected). A vote or block carrying one extra JSON field
with an otherwise-valid signature/hash therefore passes its topic
validator — ValidationAccept, forwarded mesh-wide — but is dropped by
every node's Subscribe loop with a Warnf, never reaching
VoteManager/ledger. The other four topics do not diverge: StateChain,
Directory, and Certificate subscribers use plain Unmarshal, matching
their validators; only Block and Vote are strict on subscribe.
- Validators:
net/gossip_validate.go:66(blockValidator) and:103(voteValidator) — plainjson.Unmarshal, then hash/PoW (block) and signature (vote) checks, thenValidationAccept. - Subscribers:
net/gossip.go:139-145(Gossip.Subscribe) and:209-216(VoteGossip.Subscribe) —json.NewDecoder+dec.DisallowUnknownFields(); decode error →Warnf(... unmarshal error ...)→continue(message dropped).
Reproduction (xe @ 89a542e, real loopback libp2p hosts)
Codec level (TestR8ValidatorSubscriberDivergence,
zz_r8_units_test.go): byte-surgery injection appending one extra field
to a marshalled VoteMsg/BlockMsg, preserving the signed bytes
exactly — validator-style unmarshal accepts, subscriber-style strict
decode rejects with json: unknown field "future_field", for BOTH vote
and block.
Live mesh (TestR8GossipUnknownFieldLive, zz_r8_gossip_test.go):
2-node real pubsub mesh; attacker publishes a validly-signed vote with
one extra field; victim runs the real VoteGossip.Subscribe loop.
Observed: the victim logged vote gossip unmarshal error: json: unknown field "future_field" (delivery to the subscriber proves the validator
Accepted it — gossipsub does not deliver rejected messages), the weird
vote was never ingested, the clean control vote was delivered, and a
garbage/oversized burst caused no panic/wedge. Full harness run 20/20
PASS (~/workspace/work/xe-hunt-r8/full-run.log).
Impact
Two consequences, stated with their bounds. (a) Forward-compat break:
any future client version emitting a new field has its votes/blocks
propagated-but-never-ingested network-wide — the producer sees gossip
acceptance while zero nodes ingest. No producer emits unknown fields
today, so this bites on version skew, not on the current network; no
consensus split is claimed (the drop is uniform across nodes). (b)
Log-spam vector: a modified client can emit valid-signature
unknown-field votes that every node Warnf-logs (no PoW on votes);
volume is bounded by the rotating writer's size/file caps, and the
per-message verify cost is the one XE-8347 already claims — disclosed
so triage can weigh it. Minor: a proven codec divergence with a
one-line-class fix, whose worst case is silent network-wide vote/block
loss during an upgrade.
Duplicate check (queries re-run 15 Nov 2026; neighbour bodies read)
DisallowUnknownFields(1 hit): XE-11788 — statechain sync nil-block dereference crash, body read; different subsystem, different mechanism (nil deref, not unknown-field divergence).unknown field(1 hit): XE-1968 —ValidateGenesisnever callsValidateOp; genesis validation, unrelated (title-level).forward compat(0 hits).unknown-field/strict decodwordings covered by the above; no ticket names the validator/subscriber divergence.- Family: XE-8347 (vote flood, body read in full in R8) claims
verify-cost flooding by valid-signature votes — a distinct mechanism
from this codec divergence; the log-spam overlap is disclosed above.
XE-2620 (
enqueueVote) is a different drop path. Nothing title-only except XE-1968, whose title rules it out.
Suggested fix
Make validators and subscribers agree on unknown fields — either
strict-decode in the validators (Reject unknown fields, with score
penalty, so bad messages are not forwarded) or drop
DisallowUnknownFields in the two Subscribe loops (so
validator-accepted messages are ingestible). Either direction closes
the propagated-but-never-ingested gap.
Thread
Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-13208 and says what differs; it is read like any other.