CVE-2026-134845: pgjdbc does not enforce TLS for some ssl, service and DataSource settings
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 pgservice.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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pgjdbcto a version that resolves this vulnerability.Fixed in 42.7.15
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Applications using pgjdbc versions 9.4.1208 through 42.7.14 are affected when they rely on certain TLS-requesting ssl values without explicitly setting sslmode, pass a service through Properties rather than the JDBC URL, or reuse a BaseDataSource after setting its URL.
What does an attacker need to exploit it?
An attacker must be on the network path between the application and PostgreSQL. They can then read and modify traffic when the affected configuration fails to enforce TLS.
Are configurations that request TLS by default necessarily protected?
No. If sslmode is unset, ssl values such as 1, on, yes, or verify-full can result in sslmode=prefer, and versions before 42.2.5 may use no TLS. A service specified in Properties is ignored, so its pg_service.conf sslmode setting is not applied.
What should be done if the application uses an affected driver?
Upgrade to pgjdbc 42.7.15. Until then, explicitly set sslmode in the connection URL rather than relying on ssl values or a service supplied through Properties, and review BaseDataSource usage where setUrl() follows settings for sslmode, channelBinding, or gssEncMode.