{"id":"XE-13321","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"466","source_url":"https://github.com/xeprotocol/xe/issues/466","reporter_id":2483,"title":"[net/gossip.go] C5: gossipHandler() tidak handle message yang tidak valid — security vulnerability","area":"p2p-sync","claimed_tier":null,"assessed_tier":null,"verdict":"invalid","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"invalid","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:09.403162+00:00","updated_at":"2026-11-20T00:51:29.209540+00:00","source_created_at":"2026-11-12T02:56:44+00:00","told_at":"2026-11-20T00:50:54+00:00","status_changed_at":"2026-11-20T00:33:27.568945+00:00","url":"https://bounty.xe.network/XE-13321","body":"## Ringkasan\nKalau message tidak valid, handler bisa dieksploitasi untuk melakukan sesuatu yang tidak diinginkan.\n\n## Lokasi\n- File: `net/gossip.go`\n- Lines: 219-245\n\n## Kode\n```go\nfunc (g *Gossip) gossipHandler(stream network.Stream) {\n    ...\n    var msg GossipMessage\n    if err := gob.NewDecoder(stream).Decode(&msg); err != nil {\n        logging.Debugf(\"gossip: failed to decode message: %v\", err)\n        return\n    }\n    g.handleMessage(msg)\n}\n```\n\n## Impact\nSecurity vulnerability kalau message tidak valid. Bisa dieksploitasi untuk melakukan sesuatu yang tidak diinginkan.\n\n## Suggested Fix\n```go\nfunc (g *Gossip) gossipHandler(stream network.Stream) {\n    ...\n    var msg GossipMessage\n    if err := gob.NewDecoder(stream).Decode(&msg); err != nil {\n        logging.Debugf(\"gossip: failed to decode message: %v\", err)\n        return\n    }\n    \n    // validasi message sebelum handle\n    if !g.isValidMessage(msg) {\n        logging.Warnf(\"gossip: invalid message received\")\n        return\n    }\n    \n    g.handleMessage(msg)\n}\n\nfunc (g *Gossip) isValidMessage(msg GossipMessage) bool {\n    // validasi field yang wajib\n    if msg.Key == \"\" {\n        return false\n    }\n    if msg.Sender == \"\" {\n        return false\n    }\n    // validasi tipe message\n    switch msg.Type {\n    case GossipMessageTypeSync:\n        // validasi sync message\n    case GossipMessageTypeAnnounce:\n        // validasi announce message\n    default:\n        return false\n    }\n    return true\n}\n```","patch_refs":[],"thread":[{"id":13428,"source":"github","source_ref":"7026821961","author":"XE desk","team":true,"body":"Thanks for the report. We read it against the code and could not confirm a bug in what it describes.\n\nThis report is closed as invalid. If we have missed something, file a new report that links\nhttps://bounty.xe.network/XE-13321 and says what; it is read like any other.","created_at":"2026-11-20T00:50:54+00:00"}]}