Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-54291

CVE-2026-54291: PostgreSQL JDBC Driver Info Disclosure

CVE-2026-54291 is an information disclosure vulnerability in PostgreSQL JDBC Driver that allows attackers to downgrade secure connections, removing man-in-the-middle protection. This article covers technical details, affected versions, impact, and mitigation strategies.

Published:

CVE-2026-54291 Overview

CVE-2026-54291 is a channel binding downgrade vulnerability in the pgjdbc PostgreSQL JDBC Driver. Releases 42.7.4 through 42.7.11 fail to enforce the channelBinding=require connection parameter. Connections that should use SCRAM-SHA-256-PLUS with tls-server-end-point channel binding can silently fall back to plain SCRAM-SHA-256. The downgrade eliminates the man-in-the-middle (MITM) protection the setting is meant to guarantee. An attacker positioned to intercept the TLS connection can present a certificate whose signature algorithm has no channel-binding hash, forcing the empty-binding path. The issue is tracked under [CWE-636: Not Failing Securely] and is fixed in version 42.7.12.

Critical Impact

A network-positioned attacker can defeat channel binding, break MITM protections, and impersonate the PostgreSQL server against JDBC clients that explicitly requested channelBinding=require.

Affected Products

  • PostgreSQL JDBC Driver (pgjdbc) 42.7.4
  • PostgreSQL JDBC Driver (pgjdbc) versions 42.7.5 through 42.7.11
  • Applications bundling com.ongres.scram:scram-client via pgjdbc in the affected range

Discovery Timeline

  • 2026-07-06 - CVE-2026-54291 published to NVD
  • 2026-07-09 - Last updated in NVD database

Technical Details for CVE-2026-54291

Vulnerability Analysis

The flaw sits at the intersection of the pgjdbc ScramAuthenticator and the bundled com.ongres.scram:scram-client library. When a client sets channelBinding=require, the driver must ensure that the negotiated SCRAM mechanism actually uses channel binding, meaning a -PLUS variant such as SCRAM-SHA-256-PLUS. The driver only checked that the server advertised a PLUS mechanism. It did not verify that the mechanism finally selected by the SCRAM client used channel binding, nor did it reject an empty binding value.

The underlying SCRAM client compounds the problem. When the TLS server certificate uses a signature algorithm with no defined tls-server-end-point hash, the library returns an empty byte array instead of failing closed. The driver accepts this empty binding and proceeds with plain SCRAM-SHA-256, silently discarding the MITM protection the caller requested.

Root Cause

The root cause is a missing post-negotiation invariant check. channelBinding=require was treated as an advisory hint during mechanism advertisement rather than as an enforced property of the completed handshake. Combined with a permissive empty-binding return in the SCRAM client, the requirement was effectively downgraded to prefer.

Attack Vector

Exploitation requires a network attacker able to intercept or terminate the TLS connection between the JDBC client and the PostgreSQL server. The attacker presents a certificate signed with an algorithm lacking a channel-binding hash mapping. The SCRAM client returns an empty binding, the driver skips enforcement, and authentication completes over SCRAM-SHA-256 without channel binding. The attacker can then relay or manipulate the session while remaining transparent to the client.

java
           .stringPreparation(StringPreparation.POSTGRESQL_PREPARATION)
           .build();
 
+      // channelBinding=require must never silently downgrade: regardless of how negotiation
+      // resolved, the selected mechanism must actually use channel binding (a -PLUS mechanism).
+      if (channelBinding == ChannelBinding.REQUIRE && !client.getScramMechanism().isPlus()) {
+        throw new PSQLException(
+            GT.tr("Channel Binding is required, but the negotiated SCRAM mechanism \"{0}\" "
+                + "does not use channel binding.", client.getScramMechanism().getName()),
+            PSQLState.CONNECTION_REJECTED);
+      }
+
       LOGGER.log(Level.FINEST, () -> " Using SCRAM mechanism: "
           + client.getScramMechanism().getName());
       return client;

Source: pgjdbc commit 77df98e. The patch adds an explicit check that fails the handshake when channelBinding == REQUIRE and the negotiated mechanism is not a -PLUS variant.

Detection Methods for CVE-2026-54291

Indicators of Compromise

  • PostgreSQL authentication logs showing SCRAM-SHA-256 (non-PLUS) sessions from clients configured with channelBinding=require.
  • Unexpected TLS certificate changes on the PostgreSQL server path, especially certificates using signature algorithms without a defined tls-server-end-point hash.
  • JDBC client dependency manifests referencing org.postgresql:postgresql versions 42.7.4 through 42.7.11.

Detection Strategies

  • Inventory application dependencies with an SBOM tool and flag any pgjdbc version in the vulnerable range.
  • Enable PostgreSQL log_connections and correlate the negotiated SCRAM mechanism with client configuration to detect silent downgrades to non-PLUS mechanisms.
  • Monitor TLS termination points and network paths for anomalous certificate reissuance targeting database traffic.

Monitoring Recommendations

  • Alert on any SCRAM-SHA-256 authentication event when policy mandates SCRAM-SHA-256-PLUS.
  • Track outbound JDBC connections from application hosts and baseline the destination certificate fingerprints for database endpoints.
  • Feed PostgreSQL server logs and application connection logs into a centralized data lake for cross-source correlation.

How to Mitigate CVE-2026-54291

Immediate Actions Required

  • Upgrade pgjdbc to version 42.7.12 or later across all applications and container images.
  • Audit connection strings and JDBC properties to confirm channelBinding=require is actually set where MITM protection is required.
  • Rotate any PostgreSQL credentials that may have traversed an untrusted network segment while the vulnerable driver was in use.

Patch Information

The fix is available in pgjdbc 42.7.12. See the GitHub Security Advisory GHSA-j92g-9f8w-j867 and the remediation commit 77df98e. The bundled SCRAM client is addressed in ongres/scram release 3.3, which returns a proper failure instead of an empty binding for unsupported signature algorithms.

Workarounds

  • Enforce mutual TLS or certificate pinning between application hosts and PostgreSQL servers to reduce MITM feasibility until patching completes.
  • Restrict database network paths to trusted segments and require IPsec or a service mesh with verified peer identity for cross-zone traffic.
  • Where possible, deploy PostgreSQL server certificates using signature algorithms with a defined tls-server-end-point hash so that SCRAM-SHA-256-PLUS can be negotiated end-to-end.
bash
# Configuration example: upgrade pgjdbc in a Maven project
mvn versions:use-dep-version -Dincludes=org.postgresql:postgresql -DdepVersion=42.7.12 -DforceVersion=true

# JDBC URL enforcing TLS and channel binding after upgrade
jdbc:postgresql://db.internal:5432/appdb?ssl=true&sslmode=verify-full&channelBinding=require

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.