CVE-2026-134845 in pgjdbc
Summary
by MITRE • 11/23/2026
pgjdbc, the PostgreSQL JDBC Driver, does not enforce TLS for some settings that ask for it. When sslmode is not set, an ssl value such as 1, on, yes or verify-full gives sslmode=prefer, or no TLS before 42.2.5. A service given in the Properties instead of the URL is ignored, so the sslmode of its pg_service.conf entry is lost. BaseDataSource.setUrl() keeps an sslmode, channelBinding or gssEncMode that was set before it. An attacker on the network path can then read and change the traffic. Versions 9.4.1208 through 42.7.14 are affected, and 42.7.15 fixes the problem.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 11/23/2026
The PostgreSQL JDBC Driver, known as pgjdbc, contains a critical security flaw related to Transport Layer Security enforcement that affects database connectivity integrity. In versions ranging from 9.4.1208 through 42.7.14, the driver fails to strictly enforce TLS encryption for specific configuration settings intended to secure connections. This vulnerability stems from inconsistent handling of SSL mode parameters and service configurations, allowing an attacker positioned on the network path to perform man-in-the-middle attacks. By intercepting traffic that should be encrypted, the adversary can read sensitive data transmitted between the application and the database or modify queries and responses in transit, compromising confidentiality and integrity.
The core technical flaw involves how the driver interprets SSL mode settings when they are not explicitly defined as standard strings. When the sslmode parameter is omitted from the connection URL but an alternative boolean-like value such as 1, on, yes, or verify-full is provided, the driver incorrectly defaults to sslmode=prefer rather than enforcing a secure state like require or verify-full. Prior to version 42.2.5, this behavior was even more permissive, potentially allowing unencrypted connections in scenarios where encryption was expected. This misinterpretation means that applications believing they are establishing encrypted channels may actually be communicating over plaintext TCP sockets if the network path is compromised. The logic fails to map these alternative truthy values to their secure equivalents, leaving a gap between developer intent and actual security posture.
A secondary aspect of this vulnerability involves the handling of service configurations via pg_service.conf files. When a service name is specified in the Java Properties object rather than directly in the connection URL, the driver ignores the sslmode setting defined within that service configuration file. This results in the loss of intended SSL mode settings, effectively reverting to default or insecure behavior depending on other parameters present. Additionally, the BaseDataSource.setUrl() method retains previous values for sslmode, channelBinding, and gssEncMode if they were set prior to calling this method. This state retention can lead to unexpected security configurations where a developer intends to reset connection properties but inadvertently preserves older SSL settings that may not align with current security requirements or network conditions.
The operational impact of these flaws is significant for any application relying on pgjdbc for database access, particularly in environments where TLS enforcement is critical for compliance and data protection standards such as PCI DSS or HIPAA. An attacker capable of sniffing network traffic can exploit this weakness to extract credentials, query results, or transactional data that should have been encrypted. Furthermore, the ability to modify traffic allows for sophisticated injection attacks or data corruption without detection by standard application logic, which assumes the transport layer is secure. The persistence of SSL settings in BaseDataSource further complicates remediation efforts within complex applications where connection pools and dynamic URL generation are common practices.
To mitigate these risks, organizations must upgrade immediately to version 42.7.15 or later of the pgjdbc driver, which addresses these inconsistencies by enforcing stricter TLS enforcement logic. Developers should ensure that sslmode is explicitly set to secure values such as require, verify-ca, or verify-full in all connection configurations rather than relying on implicit defaults or alternative boolean representations. It is also crucial to audit codebases for instances where BaseDataSource.setUrl() is used and verify that it does not inadvertently retain insecure legacy SSL settings from previous connections. Regular security assessments should include verification of JDBC driver versions and configuration files to ensure alignment with current best practices for database connectivity security.