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

XE-13346 · Bounty

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

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

- [559449](https://bounty.xe.network/log/559449) 2026-11-20 00:50 UTC reply.mirrored
- [558521](https://bounty.xe.network/log/558521) 2026-11-20 00:49 UTC reply.sent
- [554620](https://bounty.xe.network/log/554620) 2026-11-20 00:37 UTC github.state\_pushed
- [554579](https://bounty.xe.network/log/554579) 2026-11-20 00:37 UTC github.labels
- [553381](https://bounty.xe.network/log/553381) 2026-11-20 00:33 UTC proposal.adopted
- [553219](https://bounty.xe.network/log/553219) 2026-11-20 00:33 UTC proposal.adopted
- [553218](https://bounty.xe.network/log/553218) 2026-11-20 00:33 UTC ticket.status new → closed
- [552907](https://bounty.xe.network/log/552907) 2026-11-20 00:33 UTC proposal.adopted
- [552906](https://bounty.xe.network/log/552906) 2026-11-20 00:33 UTC ticket.facts area
- [552904](https://bounty.xe.network/log/552904) 2026-11-20 00:33 UTC proposal.adopted
- [552903](https://bounty.xe.network/log/552903) 2026-11-20 00:33 UTC ticket.facts
- [550280](https://bounty.xe.network/log/550280) 2026-11-20 00:28 UTC note.added

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

### Report

## Ringkasan

Kalau message tidak valid, handler bisa menyebabkan logging issues.

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

Logging issues kalau message tidak valid. Bisa menyebabkan log tidak mencukupi.

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