PostgreSQL JDBC Driver
CVE-2026-107315
MEDIUM
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate to affected Java application
-
DeliveryInvoke write API with over-declared length
-
ExploitDriver pads value with send-buffer bytes
-
ExecutionServer stores leftover traffic in value
-
PersistRead value back
-
ImpactHarvest other requests' SQL and parameters
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V14 - Data Protection Sensitive info in resource not removed before reuse
|
| Exploitation Conditions | Exploitation requires an affected pgjdbc version (42.7.4 through 42.7.13) and an application that declares a value length larger than the data it actually supplies through one of these specific APIs: PreparedStatement.setObject with a ByteStreamWriter, CopyIn.writeToCopy, PGCopyOutputStream.write, LargeObject.write, or Blob.setBytes. The attacker must be able to cause the application to store such a value and then read it back. Meaningful cross-tenant leakage additionally requires a pooled/shared connection so that the residual send-buffer bytes contain other requests' SQL text and parameters; GSS encryption raises the leak size from 8192 to 16320 bytes per value. Limiting factors: applications whose declared lengths always match their supplied data are not affected at all, versions 42.7.3 and earlier pad with zeros (not vulnerable), and the attacker needs authenticated access to the application to both store and retrieve the padded value. |
| Impact | This is a moderate, conditional information-disclosure flaw rather than a high-priority emergency. The provided CVSS 3.1 vector (AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N, base 5.3) is internally consistent with the description: network-reachable but High attack complexity because exploitation depends on a specific application coding pattern (declaring a length larger than the data supplied via particular APIs) and on a pooled-connection deployment where another tenant's traffic is still resident in the send buffer. Low privileges (PR:L) reflect that the attacker must be an authenticated user of the affected application able to store and read back a value. There is no EPSS score, no CISA KEV listing, and no POC referenced in the input, so there is no signal of active or probable near-term exploitation - no public exploit identified at time of analysis. The C:H/I:N/A:N shape is appropriate: the only consequence is leakage of up to 8192 bytes (16320 with GSS encryption) of recent SQL text and parameter values, which on a pooled connection may belong to other requests - potentially sensitive, but requiring a vulnerable usage pattern that most applications do not exhibit. Net: real but niche; prioritize patching for Java applications that use the named write APIs with mismatched declared lengths, but this is not a mass-exploitation candidate. |
| Exploit ScenarioDerived | A multi-tenant Java web application uses pgjdbc with a shared connection pool and stores a value (for example via Blob.setBytes or CopyIn.writeToCopy) declaring a length longer than the bytes it actually supplies. An authenticated attacker triggers this store and then reads the value back, receiving the padding - leftover send-buffer bytes containing SQL text and parameter values from other users' recent statements on the same pooled connection. No public exploit code is identified at time of analysis, and exploitation depends on the application's specific use of the affected APIs. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 07, 2026
Residual-data disclosure in the PostgreSQL JDBC Driver (pgjdbc) 42.7.4 through 42.7.13 allows an authenticated attacker who can influence how an application writes a value to recover SQL text and parameter values belonging to earlier statements on the same connection. When an application declares a value length larger than the bytes it actually supplies through PreparedStatement.setObject with a ByteStreamWriter, CopyIn.writeToCopy, PGCopyOutputStream.write, LargeObject.write, or Blob.setBytes, the driver pads the shortfall with whatever bytes remain in its send buffer instead of zeros, exposing up to 8192 bytes of recent traffic per value (16320 bytes when GSS encryption is in use); on a pooled connection those bytes may belong to other tenants or requests. Exploitation is conditional rather than trivial: the affected application must both store and read back such a padded value, its declared lengths must not always match its data, and any cross-request leakage depends on connection pooling, which is why the vendor rates this 5.3 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N). No public exploit code was identified at time of analysis, and there is no confirmed active exploitation (not in CISA KEV).
RemediationAI
Patch availability is documented through the vendor security advisory at https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-f64h-wr5q-3qf3; consult it for the recommended fixed release, since the input data does not state an exact patched version and no version number should be assumed. Confirm the pgjdbc version in every application that uses the driver (42.7.4 through 42.7.13 are affected) and upgrade as directed; environments that cannot upgrade immediately can pin or revert to 42.7.3 or earlier, which zero-pads short values, accepting the trade-off that they forgo unrelated fixes and features added in the 42.7.4-42.7.13 range. Because exploitation depends on a declared length exceeding the supplied data, the most targeted application-level control is to eliminate that mismatch in code that uses the streaming APIs: for PreparedStatement.setObject with a ByteStreamWriter, CopyIn.writeToCopy, PGCopyOutputStream.write, LargeObject.write, and Blob.setBytes, derive the declared length from the actual byte count (or buffer and validate the data first rather than writing a stream lazily), and add assertions or wrapper logic that reject declarations larger than the data provided - a change with no runtime security downside but requiring code review of all such call sites. Reduce cross-request exposure by shortening connection lifetimes or avoiding shared pooled connections for workloads that write variable-length binary values, understanding the trade-off is higher connection-establishment overhead. Disabling GSS encryption lowers the per-value leak ceiling from 16320 to 8192 bytes but weakens transport confidentiality and is not recommended as a primary mitigation. Also treat any values written by vulnerable driver versions as potentially containing foreign SQL text or parameter data, and consider re-writing or purging them if multi-tenant data isolation is a requirement.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw is CWE-226, Sensitive Information in Resource Not Removed Before Reuse, and lives in the pgjdbc driver's encoding path for binary parameter data. When a client binds a value through the streaming APIs (PreparedStatement.setObject with a ByteStreamWriter, CopyIn.writeToCopy, PGCopyOutputStream.write, LargeObject.write, or Blob.setBytes), the driver writes the user-supplied bytes into an internal send buffer and then must emit exactly the number of bytes the application declared in the wire-protocol length field. If the application declares more bytes than it supplies, the driver accepts the call without error and fills the remainder from the stale tail of that same buffer rather than zeroing it. Because the send buffer on a long-lived or pooled connection still holds previously written protocol messages, the padding becomes a carrier for prior SQL text and parameter values, which the PostgreSQL server then stores as legitimate data within the value; reading the value back later returns the residual bytes to the reader. The exposure window is bounded per value by the buffer size - roughly 8192 bytes normally and 16320 bytes when GSS encryption is negotiated, since the encrypted path uses a larger buffer. Critically, the defect is version-scoped: releases 42.7.3 and earlier zero-pad short values and are therefore not vulnerable, and applications whose declared lengths always equal the data they supply never trigger the padding path at all. The affected component is identified by CPE cpe:2.3:a:pgjdbc:pgjdbc:*:*:*:*:*:*:*:*.
Know when Pgjdbc gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N
AC:H because exploitation needs a specific mismatched-length API usage and a pooled connection; PR:L for authenticated application access; C:H, I:N, A:N as only data leaks.
Primary rating from Vendor (PostgreSQL).
CVSS VectorVendor: PostgreSQL
DescriptionCVE.org
pgjdbc, the PostgreSQL JDBC Driver, versions 42.7.4 through 42.7.13 pads a value that is shorter than its declared length with bytes left in its send buffer instead of zeros, and the server stores those bytes as part of the value. The bytes are messages the driver sent earlier on the same connection: SQL text and parameter values of recent statements, which on a pooled connection can come from other requests. Each padded value can carry up to 8192 bytes of this traffic, or 16320 bytes on a connection with GSS encryption. The padding happens when an application declares a length larger than the data it supplies, through PreparedStatement.setObject with a ByteStreamWriter, CopyIn.writeToCopy, PGCopyOutputStream.write, LargeObject.write, or Blob.setBytes. The driver accepts these calls without an error. An attacker who can make the application store such a value and read it back can collect earlier traffic. Applications whose declared lengths always match their data are not affected. Versions 42.7.3 and earlier pad with zeros.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)CVE.org
Channel-binding downgrade in the pgjdbc PostgreSQL JDBC Driver (releases 42.7.4 through 42.7.11) lets an active man-in-t
Values written through the PostgreSQL JDBC Driver (pgjdbc) 42.7.4 and 42.7.5 over a GSS/Kerberos-encrypted connection ca
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB