<!-- XE-13274 · [net/msg.go] L3: Handle() tidak check empty msgType — silent registration of empty key · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13274>. The page is the record; this is the same page for reading.*

XE-13274 · Bounty

# \[net/msg.go\] L3: Handle() tidak check empty msgType — silent registration of empty key

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

- [557381](https://bounty.xe.network/log/557381) 2026-11-20 00:49 UTC reply.mirrored
- [557070](https://bounty.xe.network/log/557070) 2026-11-20 00:48 UTC reply.sent
- [554218](https://bounty.xe.network/log/554218) 2026-11-20 00:36 UTC github.state\_pushed
- [554213](https://bounty.xe.network/log/554213) 2026-11-20 00:36 UTC github.labels
- [553339](https://bounty.xe.network/log/553339) 2026-11-20 00:33 UTC proposal.adopted
- [553139](https://bounty.xe.network/log/553139) 2026-11-20 00:33 UTC proposal.adopted
- [553138](https://bounty.xe.network/log/553138) 2026-11-20 00:33 UTC ticket.status new → closed
- [552635](https://bounty.xe.network/log/552635) 2026-11-20 00:33 UTC proposal.adopted
- [552634](https://bounty.xe.network/log/552634) 2026-11-20 00:33 UTC ticket.facts area
- [552626](https://bounty.xe.network/log/552626) 2026-11-20 00:33 UTC proposal.adopted
- [552625](https://bounty.xe.network/log/552625) 2026-11-20 00:33 UTC ticket.facts
- [551019](https://bounty.xe.network/log/551019) 2026-11-20 00:31 UTC note.added

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

### Report

## Ringkasan

Tidak ada check apakah `msgType` adalah empty string. Kalau empty, handler di-register dengan key kosong dan tidak bisa dipanggil dari `handleMessage` (yang cuma baca 1 byte).

## Lokasi

- File: `net/msg.go`
- Lines: 147-151

## Kode

```
func (m *Messenger) Handle(msgType string, handler func(peer.ID, json.RawMessage) (json.RawMessage, error)) {
    m.mu.Lock()
    m.handlers[msgType] = handler
    m.mu.Unlock()
}
```

## Impact

Handler dengan key kosong tidak bisa di-invoke. Resource waste.

## Suggested Fix

```
func (m *Messenger) Handle(msgType string, handler func(peer.ID, json.RawMessage) (json.RawMessage, error)) {
    if msgType == "" {
        logging.Warnf("msg: attempt to register handler with empty msgType")
        return
    }
    m.mu.Lock()
    m.handlers[msgType] = handler
    m.mu.Unlock()
}
```

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