Description
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.
Published: 2026-10-07
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Private Data Leakage
Action: Patch Now
AI Analysis

Impact

The PostgreSQL JDBC driver pads a value that is shorter than its declared length with leftover bytes from earlier messages on the same connection rather than zeros. These residues can include SQL text and parameter values from previous statements, up to 8 KB or 16 KB when GSS encryption is used. The driver accepts the mismatched length silently, allowing an attacker who can influence an application to write such a value and later read it back to retrieve previously sent traffic. This is an information‑leak flaw that compromises confidentiality of data that should be protected.

Affected Systems

Affected systems are installations of the PostgreSQL JDBC driver with version numbers 42.7.4 through 42.7.13. These releases adopt byte‑padding from earlier connection traffic. Versions 42.7.3 and earlier pad with zeros and are unaffected.

Risk and Exploitability

Risk assessment places the vulnerability at a CVSS score of 5.3, indicating moderate severity. The EPSS score of < 1% reflects a very low probability of exploitation in the wild. The vulnerability is not listed in CISA’s KEV catalog. It is exploitable via any application that declares a length longer than the supplied byte data, such as PreparedStatement.setObject, CopyIn.writeToCopy, PGCopyOutputStream.write, LargeObject.write, or Blob.setBytes. The attack requires the adversary to control or influence the application to store a padded value and later read it back to retrieve previously sent traffic.

Generated by OpenCVE AI on October 9, 2026 at 03:35 UTC.

Remediation

Vendor Workaround

Make the declared length match the data: ByteStreamWriter.getLength() must equal the number of bytes writeTo() writes, and the (offset, length) passed to the byte-array methods must lie within the array. No connection property turns the behavior off.


OpenCVE Recommended Actions

  • Upgrade the PostgreSQL JDBC driver to a version that implements zero padding, such as 42.7.3 or any later release that contains the official fix.
  • Revise application code to guarantee that the declared length equals the actual byte data length; align ByteStreamWriter.getLength() with the number of bytes sent and verify that the offset and length parameters lie within the byte array bounds.
  • If a driver upgrade cannot be performed immediately, isolate or reset pooled connections after each transaction to prevent cross‑request data leakage; avoid using prepared statements or copy operations that declare oversized lengths from untrusted sources.

Generated by OpenCVE AI on October 9, 2026 at 03:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 09 Oct 2026 00:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-908
References
Metrics threat_severity

None

threat_severity

Moderate


Thu, 08 Oct 2026 15:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Thu, 08 Oct 2026 00:45:00 +0000

Type Values Removed Values Added
First Time appeared Pgjdbc
Pgjdbc pgjdbc
Vendors & Products Pgjdbc
Pgjdbc pgjdbc

Wed, 07 Oct 2026 23:30:00 +0000

Type Values Removed Values Added
Description 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.
Title pgjdbc pads a value shorter than its declared length with bytes of earlier statements (rather than zeros)
Weaknesses CWE-201
CWE-226
References
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: PostgreSQL

Published:

Updated: 2026-10-08T14:41:49.791Z

Reserved: 2026-10-07T16:53:39.434Z

Link: CVE-2026-107315

cve-icon Vulnrichment

Updated: 2026-10-08T14:40:42.870Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-10-08T00:16:33.690

Modified: 2026-10-08T20:49:23.240

Link: CVE-2026-107315

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-10-07T23:03:18Z

Links: CVE-2026-107315 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-09T03:45:16Z

Weaknesses
  • CWE-201

    Insertion of Sensitive Information Into Sent Data

  • CWE-226

    Sensitive Information in Resource Not Removed Before Reuse

  • CWE-908

    Use of Uninitialized Resource