CVE-2026-134846 in pgjdbcinfo

Summary

by MITRE • 11/23/2026

pgjdbc, the PostgreSQL JDBC Driver, does not check the token state that GSSContext.unwrap() reports on a GSS-encrypted connection. An attacker on the network path can replay an earlier server packet from the same connection, and the driver accepts it as the answer to the current query. The driver also shares one MessageProp between reading and writing. One integrity-only packet from the server then makes the driver send later SQL and parameters without encryption. Only connections with gssEncMode=prefer or require that start GSS encryption are affected. Versions 42.2.15 through 42.7.14 are affected, and 42.7.15 fixes the problem.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/23/2026

The PostgreSQL JDBC Driver contains a critical security vulnerability related to its handling of Generic Security Services Application Program Interface encryption on established connections. This flaw specifically impacts drivers configured with gssEncMode set to prefer or require, which initiate GSS-based encryption for communication between the client and the database server. The core technical deficiency lies in the driver's failure to validate the token state returned by the GSSContext.unwrap method when processing incoming packets from the server. In a properly secured implementation, this context object provides metadata regarding the integrity and confidentiality status of the decrypted message, including flags that indicate whether the data has been tampered with or if it is part of an expected sequence. By ignoring these indicators, the driver effectively treats all successfully decrypted payloads as valid, regardless of their actual security properties or sequencing validity.

This oversight enables a sophisticated man-in-the-middle attacker positioned on the network path to perform packet replay attacks against active database sessions. Because the driver does not verify that incoming packets correspond strictly to the current query execution context, an adversary can intercept and store legitimate server responses from previous queries within the same connection session. The attacker can then inject these older, cached packets into the live traffic stream at a later time. Since the JDBC driver accepts this replayed data as the authentic answer to the currently executing SQL statement, it proceeds with application logic based on stale or manipulated results. This breaks the fundamental assumption of query-response correlation, allowing an attacker to potentially extract sensitive information by forcing the database to return historical data that may contain privileged details not intended for the current user context.

Beyond replay attacks, the vulnerability extends to a severe degradation of confidentiality due to improper state management within the encryption layer. The driver utilizes a single MessageProp object shared across both reading and writing operations during the GSS negotiation process. This architectural choice introduces a cross-contamination risk where integrity-only packets from the server can inadvertently alter the security properties expected for subsequent outgoing messages. Specifically, if the server sends an integrity-protected but unencrypted packet, it may cause the driver to incorrectly determine that encryption is no longer required or appropriate for future transmissions. Consequently, the JDBC driver begins sending subsequent SQL statements and their associated parameters in plaintext over the network. This effectively bypasses all confidentiality protections provided by GSS encryption, exposing sensitive query structures, parameter values, and potentially credentials to any observer on the network path who can monitor traffic but cannot decrypt it under normal circumstances.

The operational impact of this vulnerability is significant for applications relying on PostgreSQL JDBC drivers within untrusted or semi-trusted networks such as cloud environments, container orchestration platforms, or multi-tenant infrastructure. Attackers with local network access can exploit these flaws to perform data exfiltration through replayed historical queries or to intercept sensitive input data that was intended to be encrypted in transit. The severity is compounded by the fact that many organizations configure their database connections to prefer encryption without strictly enforcing it, leaving them vulnerable if an attacker successfully downgrades the connection state via the described mechanism. This behavior violates core principles of secure communication protocols where session integrity and confidentiality must be maintained consistently throughout the lifecycle of a connection.

To mitigate this risk, immediate action is required for all systems utilizing affected versions of the PostgreSQL JDBC Driver. The primary remediation strategy involves upgrading to version 42.7.15 or later, which addresses these flaws by implementing proper validation of GSSContext token states and correcting the MessageProp handling logic to ensure that integrity-only packets do not compromise subsequent encryption requirements. For environments where an immediate upgrade is not feasible, administrators should consider enforcing strict network segmentation to prevent unauthorized access between application servers and database hosts. Additionally, configuring gssEncMode to require rather than prefer may reduce exposure by ensuring connections are only established when full mutual authentication and strong encryption can be guaranteed, although this does not fully mitigate the flaw if the underlying driver version remains outdated. Organizations should also audit their network monitoring capabilities to detect anomalous packet replay patterns or unexpected plaintext transmissions on database ports as a compensating control while patching is underway.

This vulnerability aligns with CWE-347 Improper Verification of Cryptographic Signature, as the application fails to adequately verify that the received data matches expected security properties and sequence integrity. It also relates to CWE-201 Insertion of Sensitive Information Into Sent Data due to improper encryption handling, which allows sensitive parameters to be transmitted in cleartext. From a threat modeling perspective consistent with MITRE ATT&CK techniques, this flaw facilitates T1557 Adversary-in-the-Middle for credential and data interception via GSSAPI negotiation manipulation, as well as T1076 Remote Data Staging if attackers cache packets for later replay to extract historical sensitive information. The combination of these technical failures represents a critical breakdown in the security boundary between client and database, necessitating urgent patching and configuration review across all affected deployments.

Responsible

PostgreSQL

Reservation

11/22/2026

Disclosure

11/23/2026

Moderation

accepted

CPE

ready

EPSS

0.00192

KEV

no

Activities

very low

Sources

Do you need the next level of professionalism?

Upgrade your account now!