Why
server/ssh/server.go accepts connections with no handshake deadline and no per-connection channel cap. Every session channel starts another goroutine; every git-receive-pack starts another process. There is no connection cap or per-IP backoff. Existing host-key permissions are not checked.
Scope
- Set a handshake deadline on the raw connection, then clear it after
NewServerConn. - Add a per-listener connection cap and a per-connection session/channel cap.
- Add a global Git process semaphore.
- Reject oversized
execcommands and bound thevole-runnerJSON decoder. - Fail startup if an existing host key is group/world-readable.
- Consider per-IP connection/auth backoff for unknown keys.
Acceptance
- Handshake-slowloris and channel-flood tests leave CPU and file descriptors bounded.
- A host key with loose permissions is refused or corrected.