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

XE-13320 · Bounty

# \[net/gossip.go\] C4: broadcast() tidak handle message yang tidak valid — infinite loop

Closed · invalid
—
[xe#465](https://github.com/xeprotocol/xe/issues/465)
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

- [559534](https://bounty.xe.network/log/559534) 2026-11-20 00:50 UTC reply.mirrored
- [558585](https://bounty.xe.network/log/558585) 2026-11-20 00:49 UTC reply.sent
- [554878](https://bounty.xe.network/log/554878) 2026-11-20 00:37 UTC github.state\_pushed
- [554867](https://bounty.xe.network/log/554867) 2026-11-20 00:37 UTC github.labels
- [553412](https://bounty.xe.network/log/553412) 2026-11-20 00:33 UTC proposal.adopted
- [553278](https://bounty.xe.network/log/553278) 2026-11-20 00:33 UTC proposal.adopted
- [553277](https://bounty.xe.network/log/553277) 2026-11-20 00:33 UTC ticket.status new → closed
- [553023](https://bounty.xe.network/log/553023) 2026-11-20 00:33 UTC proposal.adopted
- [553022](https://bounty.xe.network/log/553022) 2026-11-20 00:33 UTC ticket.facts area
- [553020](https://bounty.xe.network/log/553020) 2026-11-20 00:33 UTC proposal.adopted
- [553019](https://bounty.xe.network/log/553019) 2026-11-20 00:33 UTC ticket.facts
- [550027](https://bounty.xe.network/log/550027) 2026-11-20 00:26 UTC note.added

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

### Report

## Ringkasan

Kalau message tidak valid, broadcast bisa menyebabkan infinite loop kalau message terus di-broadcast.

## Lokasi

- File: `net/gossip.go`
- Lines: 171-187

## Kode

```
func (g *Gossip) broadcast(key string, msg []byte, mode GossipMode) {
    ...
    for _, pid := range peers {
        go g.sendToPeer(pid, key, msg)
    }
}
```

## Impact

Infinite loop kalau message tidak valid terus di-broadcast.

## Suggested Fix

```
func (g *Gossip) broadcast(key string, msg []byte, mode GossipMode) {
    ...
    // validasi message sebelum broadcast
    if !g.isValidMessage(msg) {
        logging.Warnf("gossip: invalid message, not broadcasting")
        return
    }

    for _, pid := range peers {
        go g.sendToPeer(pid, key, msg)
    }
}

func (g *Gossip) isValidMessage(msg []byte) bool {
    // validasi message
    if len(msg) == 0 {
        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-13320 and says what; it is read like any other.
