<!-- XE-13283 · [net/msg.go] L12: handleMessage() tidak handle message yang terlalu besar — memory exhaustion · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13283>. The page is the record; this is the same page for reading.*

XE-13283 · Bounty

# \[net/msg.go\] L12: handleMessage() tidak handle message yang terlalu besar — memory exhaustion

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

### Patches

None linked.

### History

- [557267](https://bounty.xe.network/log/557267) 2026-11-20 00:49 UTC reply.mirrored
- [557056](https://bounty.xe.network/log/557056) 2026-11-20 00:48 UTC reply.sent
- [554527](https://bounty.xe.network/log/554527) 2026-11-20 00:37 UTC github.state\_pushed
- [554513](https://bounty.xe.network/log/554513) 2026-11-20 00:37 UTC github.labels
- [553328](https://bounty.xe.network/log/553328) 2026-11-20 00:33 UTC proposal.adopted
- [553118](https://bounty.xe.network/log/553118) 2026-11-20 00:33 UTC proposal.adopted
- [553117](https://bounty.xe.network/log/553117) 2026-11-20 00:33 UTC ticket.status new → closed
- [552521](https://bounty.xe.network/log/552521) 2026-11-20 00:33 UTC proposal.adopted
- [552520](https://bounty.xe.network/log/552520) 2026-11-20 00:33 UTC ticket.facts area
- [552516](https://bounty.xe.network/log/552516) 2026-11-20 00:33 UTC proposal.adopted
- [552515](https://bounty.xe.network/log/552515) 2026-11-20 00:33 UTC ticket.facts
- [551127](https://bounty.xe.network/log/551127) 2026-11-20 00:31 UTC note.added

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

### Report

## Ringkasan

Tidak ada size limit pada message yang diterima. Kalau peer mengirim message yang sangat besar, bisa menyebabkan memory exhaustion.

## Lokasi

- File: `net/msg.go`
- Lines: 100-114

## Kode

```
func (m *Messenger) handleMessage(raw []byte) {
    if len(raw) < 1 {
        return
    }
    msgType := string(raw[0])
    payload := raw[1:]
    handler, ok := m.getHandler(msgType)
    if !ok {
        return
    }
    go handler(peer.ID(raw[0:32]), payload)  // payload bisa sangat besar
}
```

## Impact

Memory exhaustion kalau peer malicious mengirim message besar (misal 1GB\+). Bisa menyebabkan OOM.

## Suggested Fix

```
const maxMessageSize = 10 * 1024 * 1024  // 10 MB

func (m *Messenger) handleMessage(raw []byte) {
    if len(raw) < 1 {
        return
    }
    if len(raw) > maxMessageSize {
        logging.Warnf("msg: message too large (%d bytes), dropping", len(raw))
        return
    }
    msgType := string(raw[0])
    payload := raw[1:]
    handler, ok := m.getHandler(msgType)
    if !ok {
        return
    }
    go handler(peer.ID(raw[0:32]), payload)
}
```

### Thread

**XE desk**team2026-11-20 00:49 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-13283 and says what; it is read like any other.
