pgjdbc pads a value shorter than its declared length with bytes of earlier statements (rather than zeros)
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.
CVE-2026-107315
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: cve:CVE-2026-107315
pgjdbc
Source reference: /containers/cna/affected/0/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"repo": "https://github.com/pgjdbc/pgjdbc",
"vendor": "pgjdbc",
"product": "pgjdbc",
"versions": [
{
"status": "affected",
"version": "42.7.4",
"versionType": "maven",
"lessThanOrEqual": "42.7.13"
}
],
"packageName": "org.postgresql:postgresql",
"programFiles": [
"pgjdbc/src/main/java/org/postgresql/util/internal/PgBufferedOutputStream.java"
],
"collectionURL": "https://repo.maven.apache.org/maven2",
"defaultStatus": "unaffected",
"programRoutines": [
{
"name": "org.postgresql.util.internal.PgBufferedOutputStream.writeZeros"
}
]
}
]- Related CVEs
- CVE-2026-107315
Source reference:
/cveMetadata/cveId
Publisher severity
medium
Source reference: /containers/cna/metrics
- Event
- #12566 · Revision 1
- Added to Heist Feed
- Publisher date