The vulnerability is a silent security downgrade in the OnGres SCRAM client library, caused by a two-part failure. The root cause is improper error handling when processing TLS server certificates.
First, the com.ongres.scram.common.util.TlsServerEndpoint.getChannelBindingData function is responsible for generating a channel binding hash from the server's X.509 certificate. When encountering a certificate with a modern signature algorithm that it cannot parse (e.g., Ed25519), the function catches the underlying NoSuchAlgorithmException and, instead of propagating the error, returns an empty byte array. This action effectively conceals a critical cryptographic failure.
Second, the com.ongres.scram.client.ScramClient$Builder.build() method consumes the output of getChannelBindingData. Its internal mechanism negotiation logic interprets the empty byte array not as a failure, but as an indication that the client environment does not support or provide channel binding. Consequently, it negotiates with the server to use a standard, non-channel-bound SCRAM mechanism (like SCRAM-SHA-256) even if a more secure -PLUS variant was available and expected. This results in a silent downgrade of the authentication mechanism, bypassing any client-side policies that require channel binding and exposing the connection to potential man-in-the-middle attacks.
The patch addresses this by introducing getChannelBindingHash, which correctly throws a NoSuchAlgorithmException on failure. It also adds a ChannelBindingPolicy to the ScramClient.Builder, allowing developers to enforce channel binding and prevent silent downgrades by throwing a ChannelBindingException if the requirements are not met.