Skip to content

fix: verify gossiped tx proposer signature before mempool entry#1312

Open
0xMayoor wants to merge 1 commit into
gonka-ai:mainfrom
0xMayoor:fix/devshard-gossip-tx-verify
Open

fix: verify gossiped tx proposer signature before mempool entry#1312
0xMayoor wants to merge 1 commit into
gonka-ai:mainfrom
0xMayoor:fix/devshard-gossip-tx-verify

Conversation

@0xMayoor

@0xMayoor 0xMayoor commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

HandleGossipNonce (server.go:560) does RecoverAddress + slot-owner match before storing. the sibling HandleGossipTxs (server.go:584) doesn't — txs land via OnTxsReceivedmempool.AddTx with only a sender-membership check.

a byzantine group member POSTs a forged MsgValidationVote{InferenceId: target, VoterSlot: <victim's own slot>, ProposerSig: garbage}. it passes membership auth, enters the victim's mempool, and the victim's collectValidationJobs (host.go:775) calls hasMempoolValidationOrVote which trips purely on slot match — no proposer-sig check. the host skips its honest validation for that inference. same shape for MsgRevealSeed via maybeRevealSeed's early-return at host.go:675-677.

never evicted: bad-sig tx never applies (applyValidationVote machine.go:862 rejects via verifyProposerSig), so mempool.RemoveIncluded never sees it; persists for the whole session.

restricting gossip to group members doesn't close this — the route is already members-only. a byzantine member passes auth and still serves a forged inner tx. orthogonal to content verification.

Fix: add StateMachine.VerifyGossipedTx mirroring the existing per-tx verifyProposerSig calls in applyValidation, applyValidationVote, applyRevealSeed. expose a Host.VerifyGossipedTx wrapper. filter at ingestion in HandleGossipTxs (server.go:584) — drop bad-sig txs before passing to OnTxsReceived, same shape as HandleGossipNonce. regression in gossip_tx_verify_test.go with reject-forged + accept-valid pairs for each of the three affected tx kinds, plus unknown-slot and pass-through-other-kinds guards.

related: #1311 (same class on the GET /sessions/:id/signatures path), both introduced by #1284.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant