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

XE-13284 · Bounty

# \[net/msg.go\] L13: request() tidak handle response yang terlalu besar — memory exhaustion

Closed · invalid
—
[xe#429](https://github.com/xeprotocol/xe/issues/429)
filed 2026-11-12 02:50 UTC
by wahyu20260100233-ops

Verdict
:   Invalid

Tier
:   —

Claimed
:   —

Area
:   P2P / sync

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 00:48 UTC

Told
:   2026-11-20 00:48 UTC

### Patches

None linked.

### History

- [557258](https://bounty.xe.network/log/557258) 2026-11-20 00:49 UTC reply.mirrored
- [557055](https://bounty.xe.network/log/557055) 2026-11-20 00:48 UTC reply.sent
- [554099](https://bounty.xe.network/log/554099) 2026-11-20 00:36 UTC github.state\_pushed
- [554094](https://bounty.xe.network/log/554094) 2026-11-20 00:36 UTC github.labels
- [553327](https://bounty.xe.network/log/553327) 2026-11-20 00:33 UTC proposal.adopted
- [553116](https://bounty.xe.network/log/553116) 2026-11-20 00:33 UTC proposal.adopted
- [553115](https://bounty.xe.network/log/553115) 2026-11-20 00:33 UTC ticket.status new → closed
- [552511](https://bounty.xe.network/log/552511) 2026-11-20 00:33 UTC proposal.adopted
- [552510](https://bounty.xe.network/log/552510) 2026-11-20 00:33 UTC ticket.facts area
- [552506](https://bounty.xe.network/log/552506) 2026-11-20 00:33 UTC proposal.adopted
- [552505](https://bounty.xe.network/log/552505) 2026-11-20 00:33 UTC ticket.facts
- [551133](https://bounty.xe.network/log/551133) 2026-11-20 00:31 UTC note.added

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

### Report

## Ringkasan

Response dari handler tidak ada size limit. Kalau handler return response yang sangat besar, bisa menyebabkan memory exhaustion.

## Lokasi

- File: `net/msg.go`
- Lines: 130-143

## Kode

```
func (m *Messenger) request(pid peer.ID, msgType string, payload interface{}, timeout time.Duration) (json.RawMessage, error) {
    ...
    respCh := make(chan msgResponse, 1)
    go func() {
        resp, err := m.invoke(pid, msgType, payload)
        respCh <- msgResponse{resp, err}
    }()
    ...
}
```

## Impact

Memory exhaustion kalau handler malicious return response besar. Bisa menyebabkan OOM.

## Suggested Fix

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

func (m *Messenger) invoke(pid peer.ID, msgType string, payload interface{}) (json.RawMessage, error) {
    ...
    resp, err := handler(pid, raw)
    if len(resp) > maxResponseSize {
        logging.Warnf("msg: response too large (%d bytes) from %s for %q", len(resp), pid, msgType)
        return nil, ErrResponseTooLarge
    }
    return resp, err
}
```

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