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

XE-13328 · Bounty

# \[net/gossip.go\] M2: gossipHandler() tidak handle message yang tidak valid — latency

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

- [559471](https://bounty.xe.network/log/559471) 2026-11-20 00:50 UTC reply.mirrored
- [558567](https://bounty.xe.network/log/558567) 2026-11-20 00:49 UTC reply.sent
- [554962](https://bounty.xe.network/log/554962) 2026-11-20 00:38 UTC github.state\_pushed
- [554960](https://bounty.xe.network/log/554960) 2026-11-20 00:38 UTC github.labels
- [553404](https://bounty.xe.network/log/553404) 2026-11-20 00:33 UTC proposal.adopted
- [553261](https://bounty.xe.network/log/553261) 2026-11-20 00:33 UTC proposal.adopted
- [553260](https://bounty.xe.network/log/553260) 2026-11-20 00:33 UTC ticket.status new → closed
- [552985](https://bounty.xe.network/log/552985) 2026-11-20 00:33 UTC proposal.adopted
- [552984](https://bounty.xe.network/log/552984) 2026-11-20 00:33 UTC ticket.facts area
- [552983](https://bounty.xe.network/log/552983) 2026-11-20 00:33 UTC proposal.adopted
- [552982](https://bounty.xe.network/log/552982) 2026-11-20 00:33 UTC ticket.facts
- [550074](https://bounty.xe.network/log/550074) 2026-11-20 00:26 UTC note.added

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

### Report

## Ringkasan

Kalau message tidak valid, handler bisa menyebabkan latency.

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

Latency kalau message tidak valid. Bisa menyebabkan response time meningkat.

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