# GHSA-CWW3-QMC2-MJMR: pgjdbc leaves a half-written message on the connection after an unchecked exception

- Database: GitHub
- Severity: CVSS 7.5 (High)
- Published: 2026-11-23
- Modified: 2026-11-23

## Tracked as

- [CVE-2026-134843](https://cve.now/CVE-2026-134843.md): pgjdbc SQL injection via desynced JDBC connection state

## Affected versions

- org.postgresql:postgresql (Maven): through 42.7.14

## Description

### Summary

An unchecked exception while pgjdbc sent parameter values could leave part of a message in the send buffer. The server could then read the bytes of a later value as a SQL command.


### Details

The driver closed the connection after an `IOException`, but not after an unchecked exception. Part of a Bind message then stayed in the send buffer, and the connection stayed open.

Since 42.6.0 a `setBinaryStream()` value without a length and over 51200 bytes is spooled and released after it is sent. Executing the statement again threw a `NullPointerException` in the middle of the Bind. The driver also retries a statement itself after SQLState `0A000` or `26000`, which a DDL change can cause.

The server read the bytes that followed as the rest of the value. The bytes of a later uploaded value could then be read as a new Query message.

In all versions, an application `InputStream` that throws an unchecked exception has the same effect.

### Proof of concept

An attacker who controls the content of an uploaded value can run SQL as the application's database role. The connection must first fail in this way. That needs a stream value that is executed again, or a stream that throws an unchecked exception.

### Impact

All versions before 42.7.15 are affected. The `setBinaryStream()` case starts in 42.6.0. 42.7.15 fixes the problem.

## References

- https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-cww3-qmc2-mjmr

Page: https://cve.now/GHSA-CWW3-QMC2-MJMR

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
