Description

A critical vulnerability, tracked as CVE-2025-49146, has been discovered in the PostgreSQL JDBC Driver (PgJDBC), affecting versions 42.7.4 through 42.7.6. The vulnerability makes it possible for attackers to intercept database connections using **man-in-the-middle (MITM)** attacks despite the driver being set to ensure channel binding for secure authentication. The vulnerability stems from a logical flaw in the driver's handling of the channelBinding=require option, which is intended to securely link the transport and authentication layers to prevent tampering. However, the driver fails to enforce this requirement and erroneously permits the use of legacy authentication methods—such as password, MD5, GSS, and SSPI—that do not support channel binding, thereby exposing applications to potential security risks. Channel binding is an important security feature intended to provide mutual trust between the server and client through checking that the TLS session is consistent with the authentication layer. In the present instance, though, the PgJDBC driver did not implement that requirement rigidly. Consequently, applications that were believed to be protected against MITM attacks could quietly default to weaker, unencrypted authentication mechanisms, without notification of the user or interruption of the connection. This quiet failure renders the vulnerability particularly perilous, as users and developers will potentially continue to work under a false belief of security. To avoid the risk, users are highly recommended to **upgrade to PgJDBC version 42.7.7**, where the problem has been addressed. As a temporary workaround, configuration of the JDBC driver's SSL mode to `sslMode=verify-full` is suggested. This configuration makes sure that both server's certificate and hostname are checked, dropping the opportunity of a successful MITM attack by a large margin even when channel binding is not properly enforced.?