The vulnerability exists in the SSH identification string parsing logic of the russh library. The server-side implementation was overly permissive, allowing clients to send pre-banner text before the SSH identification string, which violates RFC 4253. This flaw was centered in the russh::SshRead::read_ssh_id function, which would discard any lines that were not valid SSH IDs without limit, allowing a client to keep a connection in a pre-authentication state indefinitely.
A remote, unauthenticated attacker could exploit this by sending a continuous stream of malformed lines, consuming server resources (CPU and memory) and leading to a denial-of-service condition. The fix, implemented in commit 3de4a68, segregates the parsing logic. A new, stricter function, russh::SshRead::read_client_ssh_id, was introduced for server-side use, which rejects any pre-banner lines from a client. The server's connection handling logic in russh::server::read_ssh_id was updated to use this new function, effectively patching the vulnerability. The analysis of the patch clearly shows the vulnerable function and how the fix was applied.