You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
daemon/src/main.rs's TCP accept loop and shared/mcp/src/auth.rs's server_handshake implementations have no tokio::time::timeout wrapper around the
handshake read, and no cap on concurrent accepted-but-unauthenticated connections. daemon/src/config.rs's resource ceilings (max_documents, max_update_size_bytes, max_document_size_bytes) bound per-document/per-message size, but nothing bounds
total connection count or per-IP rate.
Why it matters
A client that opens the TCP/TLS connection and never sends its hello line (deliberately,
or just a flaky network dropping the line) ties up a task+socket indefinitely. Combined
with no max_connections, this is the one genuinely open-ended resource in the whole
hub model — a real risk for any demo/deployment reachable beyond localhost (even just a
shared LAN), not requiring anything sophisticated to trigger.
What's needed
Wrap the per-connection handshake read in a bounded tokio::time::timeout (a few
seconds is plenty — real clients complete the handshake near-instantly).
Add a max_connections (or per-IP) config knob (principle feat: Phase 4a M5 — async LSP AI tools #7 — no hardcoding) with
a sane default, enforced in the accept loop.
Adversarial test: an accepted-but-silent connection must be dropped within the
timeout, and a connection-count cap must actually reject the (N+1)th unauthenticated
client (principle feat: editor polish, version bump & new features (v0.3.0) #14 — the attacker's test, not just the happy path).
Source: hub-model shared-KB readiness review.
What
daemon/src/main.rs's TCP accept loop andshared/mcp/src/auth.rs'sserver_handshakeimplementations have notokio::time::timeoutwrapper around thehandshake read, and no cap on concurrent accepted-but-unauthenticated connections.
daemon/src/config.rs's resource ceilings (max_documents,max_update_size_bytes,max_document_size_bytes) bound per-document/per-message size, but nothing boundstotal connection count or per-IP rate.
Why it matters
A client that opens the TCP/TLS connection and never sends its hello line (deliberately,
or just a flaky network dropping the line) ties up a task+socket indefinitely. Combined
with no
max_connections, this is the one genuinely open-ended resource in the wholehub model — a real risk for any demo/deployment reachable beyond localhost (even just a
shared LAN), not requiring anything sophisticated to trigger.
What's needed
tokio::time::timeout(a fewseconds is plenty — real clients complete the handshake near-instantly).
max_connections(or per-IP) config knob (principle feat: Phase 4a M5 — async LSP AI tools #7 — no hardcoding) witha sane default, enforced in the accept loop.
timeout, and a connection-count cap must actually reject the (N+1)th unauthenticated
client (principle feat: editor polish, version bump & new features (v0.3.0) #14 — the attacker's test, not just the happy path).
Size: S-M.