Security: Unbounded per-connection WebSocket send queue (memory DoS) #81

Closed
opened 2026-07-08 02:40:30 +00:00 by icub3d · 0 comments
Owner

Severity: High — found in code review 2026-07-07.

Problem

server/src/gateway/connection.rs:30 uses mpsc::unbounded_channel::<String>() for each connection's outbound queue. Every broadcast_all (joins/leaves, messages, role events) pushes to each connection's sender. A client that connects, authenticates, then stops reading grows its queue without bound as server activity continues — one idle socket per attacker exhausts server memory. The heartbeat-ack timeout doesn't bound an un-flushed backlog.

Fix

  • Use a bounded channel; drop the connection (or shed messages) when the buffer fills.

Acceptance

  • Slow/stalled consumer is disconnected rather than growing memory unboundedly (test)
**Severity: High** — found in code review 2026-07-07. ## Problem `server/src/gateway/connection.rs:30` uses `mpsc::unbounded_channel::<String>()` for each connection's outbound queue. Every `broadcast_all` (joins/leaves, messages, role events) pushes to each connection's sender. A client that connects, authenticates, then **stops reading** grows its queue without bound as server activity continues — one idle socket per attacker exhausts server memory. The heartbeat-ack timeout doesn't bound an un-flushed backlog. ## Fix - [ ] Use a bounded channel; drop the connection (or shed messages) when the buffer fills. ## Acceptance - [ ] Slow/stalled consumer is disconnected rather than growing memory unboundedly (test)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
icub3d/decentcom#81
No description provided.