The vulnerability lies in the listen function in internal/ssh/ssh.go. Specifically, it's in the anonymous goroutine spawned to handle each new SSH connection. The vulnerability is a classic resource exhaustion attack. The root cause is the lack of a timeout on the initial SSH handshake. An attacker can establish a TCP connection to the SSH port and then do nothing. The server-side goroutine will then block forever in ssh.NewServerConn, waiting for the client's SSH version string. By opening many such connections, an attacker can exhaust the server's file descriptors, preventing legitimate users from connecting and potentially causing other parts of the Gogs service to fail. The patch mitigates this by adding a 15-second deadline to the connection using conn.SetDeadline before the call to ssh.NewServerConn. If the client doesn't start the SSH handshake within that time, the connection is closed. The vulnerable function is identified as listen.func1, which is the anonymous goroutine within the listen function, as this is where the blocking call occurs.