CVE-2026-134845

Information Exposure
Affects
PostgreSQL JDBC Driver
in
PostgreSQL JDBC Driver
No items found.
Versions
>=9.4.1208 <42.7.15

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

The PostgreSQL JDBC Driver (pgJDBC) is the open-source JDBC driver that lets Java programs connect to a PostgreSQL database using standard, database-independent Java code. It is a pure Java (Type 4) driver that speaks the PostgreSQL native network protocol. It is published to Maven Central as org.postgresql:postgresql, and Spring Boot 2.7 manages its 42.3 line.

An information exposure vulnerability (CVE-2026-134845) has been identified in the PostgreSQL JDBC Driver, which allows attackers on the network path to read and change the traffic of a connection whose settings ask for TLS with certificate checks. The driver falls back to sslmode=prefer, or keeps an earlier weaker setting, so TLS and certificate verification are not enforced. For some authentication methods the exposed traffic includes the password.

Per OWASP: Access control enforces policy such that users cannot act outside of their intended permissions. Failures typically lead to unauthorized information disclosure, modification, or destruction of all data or performing a business function outside the user's limits.

This issue affects multiple versions of the PostgreSQL JDBC Driver.

Details

Module Info

Vulnerability Info

This High-severity vulnerability is found in the org.postgresql:postgresql package in multiple versions of the PostgreSQL JDBC Driver. Three connection settings that ask for TLS end up with a weaker sslmode.

When sslmode is not set, SslMode.of() falls back to the ssl property. Only ssl=true or an empty ssl value gives verify-full. Any other value, such as 1, on, yes or verify-full, is parsed as a boolean false and silently gives prefer (before 42.2.5, no TLS at all):

public static SslMode of(Properties info) throws PSQLException {
  String sslmode = PGProperty.SSL_MODE.get(info);
  // If sslmode is not set, fallback to ssl parameter
  if (sslmode == null) {
    if (PGProperty.SSL.getBoolean(info) || "".equals(PGProperty.SSL.get(info))) {
      return VERIFY_FULL;
    }
    return PREFER;
  }
  ...
}

With prefer, the driver accepts a plaintext connection when the server (or an attacker posing as it) refuses TLS, and it does not check the server certificate, so an attacker can also present any certificate.

Driver.parseURL() reads the service name only from the URL's query arguments. A service passed in the Properties given to DriverManager.getConnection() is ignored without a warning, so the pg_service.conf entry is never loaded and the sslmode it sets is lost.

BaseDataSource.setUrl() only copies a property from the URL when the data source does not already hold it:

public void setUrl(String url) {
  Properties p = org.postgresql.Driver.parseURL(url, null);
  ...
  for (PGProperty property : PGProperty.values()) {
    if (!this.properties.containsKey(property.getName())) {
      setProperty(property, property.get(p));
    }
  }
}

A second setUrl() call, or a setter such as setSslMode() followed by setUrl(), therefore keeps the earlier sslmode, gssEncMode or, in releases that have it, channelBinding instead of the stricter value in the new URL. In each case the application believes TLS with certificate verification is in force while the connection can be downgraded or intercepted by an attacker on the network path.

Steps to Reproduce

1. Add org.postgresql:postgresql 42.3.10 to the classpath. No database server is needed.

2. Compile and run the following class:

import java.util.Properties;
import org.postgresql.ds.PGSimpleDataSource;
import org.postgresql.jdbc.SslMode;

public class Repro {
  public static void main(String[] args) throws Exception {
    Properties info = new Properties();
    info.setProperty("ssl", "on");
    System.out.println("ssl=on -> " + SslMode.of(info));

    PGSimpleDataSource ds = new PGSimpleDataSource();
    ds.setSslMode("prefer");
    ds.setUrl("jdbc:postgresql://db.example.com/app?sslmode=verify-full");
    System.out.println("setUrl sslmode -> " + ds.getSslMode());
  }
}

3. The output is ssl=on -> PREFER and setUrl sslmode -> prefer: neither connection would enforce TLS or verify the server certificate.

Mitigation

The PostgreSQL JDBC Driver's security policy ships security fixes by default only for the latest 42.x release line and for 42.2.x, and for other versions only upon request. Upstream has made no 42.3.x release since 42.3.10 (March 2024), so no 42.3.x release is available to address this issue. For more information, see here.

Users of the affected components should apply one of the following mitigations:

  • Upgrade affected applications to a currently supported release of the PostgreSQL JDBC Driver that contains the fix.
  • Leverage a commercial support partner like HeroDevs for post-EOL security support.

Credits

  • Anthropic OSS Scanner (finder)
Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
High
ID
CVE-2026-134845
PROJECT Affected
PostgreSQL JDBC Driver
Versions Affected
>=9.4.1208 <42.7.15
NES Versions Affected
Published date
November 23, 2026
≈ Fix date
December 4, 2026
Category
Information Exposure
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for PostgreSQL JDBC Driver
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.