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

XE-13330 · Bounty

# \[net/gossip.go\] M4: gossipHandler() tidak handle message yang tidak valid — resource utilization

Closed · invalid
—
[xe#475](https://github.com/xeprotocol/xe/issues/475)
filed 2026-11-12 02:58 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

- [559468](https://bounty.xe.network/log/559468) 2026-11-20 00:50 UTC reply.mirrored
- [558561](https://bounty.xe.network/log/558561) 2026-11-20 00:49 UTC reply.sent
- [554144](https://bounty.xe.network/log/554144) 2026-11-20 00:36 UTC github.state\_pushed
- [554141](https://bounty.xe.network/log/554141) 2026-11-20 00:36 UTC github.labels
- [553401](https://bounty.xe.network/log/553401) 2026-11-20 00:33 UTC proposal.adopted
- [553253](https://bounty.xe.network/log/553253) 2026-11-20 00:33 UTC proposal.adopted
- [553252](https://bounty.xe.network/log/553252) 2026-11-20 00:33 UTC ticket.status new → closed
- [552976](https://bounty.xe.network/log/552976) 2026-11-20 00:33 UTC proposal.adopted
- [552975](https://bounty.xe.network/log/552975) 2026-11-20 00:33 UTC ticket.facts area
- [552974](https://bounty.xe.network/log/552974) 2026-11-20 00:33 UTC proposal.adopted
- [552973](https://bounty.xe.network/log/552973) 2026-11-20 00:33 UTC ticket.facts
- [550084](https://bounty.xe.network/log/550084) 2026-11-20 00:27 UTC note.added

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

### Report

## Ringkasan

Kalau message tidak valid, handler bisa menyebabkan resource utilization meningkat.

## 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

Resource utilization meningkat kalau message tidak valid. Bisa menyebabkan resource exhaustion.

## 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
    }
    // dll
    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-13330 and says what; it is read like any other.
