<!-- XE-13321 · [net/gossip.go] C5: gossipHandler() tidak handle message yang tidak valid — security vulnerability · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13321>. The page is the record; this is the same page for reading.*

XE-13321 · Bounty

# \[net/gossip.go\] C5: gossipHandler() tidak handle message yang tidak valid — security vulnerability

Closed · invalid
—
[xe#466](https://github.com/xeprotocol/xe/issues/466)
filed 2026-11-12 02:56 UTC
by wahyu20260100233-ops

Verdict
:   Invalid

Tier
:   —

Claimed
:   —

Area
:   P2P / sync

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 00:51 UTC

Told
:   2026-11-20 00:50 UTC

### Patches

None linked.

### History

- [559524](https://bounty.xe.network/log/559524) 2026-11-20 00:50 UTC reply.mirrored
- [558582](https://bounty.xe.network/log/558582) 2026-11-20 00:49 UTC reply.sent
- [554062](https://bounty.xe.network/log/554062) 2026-11-20 00:35 UTC github.state\_pushed
- [554061](https://bounty.xe.network/log/554061) 2026-11-20 00:35 UTC github.labels
- [553411](https://bounty.xe.network/log/553411) 2026-11-20 00:33 UTC proposal.adopted
- [553276](https://bounty.xe.network/log/553276) 2026-11-20 00:33 UTC proposal.adopted
- [553275](https://bounty.xe.network/log/553275) 2026-11-20 00:33 UTC ticket.status new → closed
- [553018](https://bounty.xe.network/log/553018) 2026-11-20 00:33 UTC proposal.adopted
- [553017](https://bounty.xe.network/log/553017) 2026-11-20 00:33 UTC ticket.facts area
- [553016](https://bounty.xe.network/log/553016) 2026-11-20 00:33 UTC proposal.adopted
- [553015](https://bounty.xe.network/log/553015) 2026-11-20 00:33 UTC ticket.facts
- [550033](https://bounty.xe.network/log/550033) 2026-11-20 00:26 UTC note.added

[Full history](https://bounty.xe.network/log?ref=XE-13321) · [JSON](https://bounty.xe.network/v1/tickets/XE-13321) · [markdown](https://bounty.xe.network/XE-13321.md)

### Report

## Ringkasan

Kalau message tidak valid, handler bisa dieksploitasi untuk melakukan sesuatu yang tidak diinginkan.

## Lokasi

- File: `net/gossip.go`
- Lines: 219-245

## Kode

```
func (g *Gossip) gossipHandler(stream network.Stream) {
    ...
    var msg GossipMessage
    if err := gob.NewDecoder(stream).Decode(&msg); err != nil {
        logging.Debugf("gossip: failed to decode message: %v", err)
        return
    }
    g.handleMessage(msg)
}
```

## Impact

Security vulnerability kalau message tidak valid. Bisa dieksploitasi untuk melakukan sesuatu yang tidak diinginkan.

## Suggested Fix

```
func (g *Gossip) gossipHandler(stream network.Stream) {
    ...
    var msg GossipMessage
    if err := gob.NewDecoder(stream).Decode(&msg); err != nil {
        logging.Debugf("gossip: failed to decode message: %v", err)
        return
    }

    // validasi message sebelum handle
    if !g.isValidMessage(msg) {
        logging.Warnf("gossip: invalid message received")
        return
    }

    g.handleMessage(msg)
}

func (g *Gossip) isValidMessage(msg GossipMessage) bool {
    // validasi field yang wajib
    if msg.Key == "" {
        return false
    }
    if msg.Sender == "" {
        return false
    }
    // validasi tipe message
    switch msg.Type {
    case GossipMessageTypeSync:
        // validasi sync message
    case GossipMessageTypeAnnounce:
        // validasi announce message
    default:
        return false
    }
    return true
}
```

### Thread

**XE desk**team2026-11-20 00:50 UTCgithub

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links
https://bounty.xe.network/XE-13321 and says what; it is read like any other.
