{"id":"XE-13284","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"429","source_url":"https://github.com/xeprotocol/xe/issues/429","reporter_id":2483,"title":"[net/msg.go] L13: request() tidak handle response yang terlalu besar — memory exhaustion","area":"p2p-sync","claimed_tier":null,"assessed_tier":null,"verdict":"invalid","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"invalid","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:07.294523+00:00","updated_at":"2026-11-20T00:48:52.266019+00:00","source_created_at":"2026-11-12T02:50:03+00:00","told_at":"2026-11-20T00:48:52.268758+00:00","status_changed_at":"2026-11-20T00:33:25.781619+00:00","url":"https://bounty.xe.network/XE-13284","body":"## Ringkasan\nResponse dari handler tidak ada size limit. Kalau handler return response yang sangat besar, bisa menyebabkan memory exhaustion.\n\n## Lokasi\n- File: `net/msg.go`\n- Lines: 130-143\n\n## Kode\n```go\nfunc (m *Messenger) request(pid peer.ID, msgType string, payload interface{}, timeout time.Duration) (json.RawMessage, error) {\n    ...\n    respCh := make(chan msgResponse, 1)\n    go func() {\n        resp, err := m.invoke(pid, msgType, payload)\n        respCh <- msgResponse{resp, err}\n    }()\n    ...\n}\n```\n\n## Impact\nMemory exhaustion kalau handler malicious return response besar. Bisa menyebabkan OOM.\n\n## Suggested Fix\n```go\nconst maxResponseSize = 10 * 1024 * 1024  // 10 MB\n\nfunc (m *Messenger) invoke(pid peer.ID, msgType string, payload interface{}) (json.RawMessage, error) {\n    ...\n    resp, err := handler(pid, raw)\n    if len(resp) > maxResponseSize {\n        logging.Warnf(\"msg: response too large (%d bytes) from %s for %q\", len(resp), pid, msgType)\n        return nil, ErrResponseTooLarge\n    }\n    return resp, err\n}\n```","patch_refs":[],"thread":[{"id":13355,"source":"github","source_ref":"7026790027","author":"XE desk","team":true,"body":"Thanks for the report. We read it against the code and could not confirm a bug in what it describes.\n\nThis report is closed as invalid. If we have missed something, file a new report that links\nhttps://bounty.xe.network/XE-13284 and says what; it is read like any other.","created_at":"2026-11-20T00:49:21+00:00"}]}