The vulnerability allows a remote, unauthenticated attacker to cause a denial of service by exhausting file descriptors and goroutines. This is achieved by sending an 8-byte Postgres SSLRequest (STARTTLS) prelude to a Traefik TCP entrypoint and then stalling.
The root cause is in the ServeTCP function within pkg/server/router/tcp/router.go. Upon detecting a Postgres request, this function would prematurely clear the connection's read timeout by calling conn.SetDeadline(time.Time{}). It would then pass the connection to the servePostgres handler in pkg/server/router/tcp/postgres.go.
The servePostgres function would then wait for the next part of the TLS handshake (the ClientHello). However, since the read deadline was already cleared, a malicious client could simply not send any more data, causing the servePostgres function to block indefinitely. Each stalled connection would consume a file descriptor and a goroutine, eventually exhausting the server's resources.
The patch rectifies this by removing the deadline-clearing logic from ServeTCP and moving it inside servePostgres. The deadline is now only cleared after the initial STARTTLS negotiation and ClientHello have been successfully read, ensuring that the connection cannot hang during this initial phase. Therefore, both Router.ServeTCP and Router.servePostgres are critical functions in the execution path of this vulnerability.