All reports
High

postgresql-odbc: postgresql-odbc: Arbitrary code execution via heap buffer overflow during cursor fetch

Affected versions

Affected versions
Unknown
Fixed version
Not reported
Affected versions
Unknown
Fixed version
Not reported
Affected versions
Unknown
Fixed version
Not reported
Affected versions
Unknown
Fixed version
Not reported
Affected versions
Unknown
Fixed version
Not reported

Exploitation

CVE-2026-120058

Probability of exploitation in the next 30 days: 0.26%

FIRST EPSS · 2026-11-21

Description

psqlODBC sizes its row cache from the column count of a cursor's first result, but recomputes the column count from each later FETCH reply without checking that it matches. A server not trusted under current SSL settings can answer a later FETCH with more columns and make the driver write tuple records past the end of the heap allocation. A keyset reply with fewer columns than the key fields also underflows the unsigned field count. This is reachable with UseDeclareFetch enabled. Versions before psqlODBC 18.00.0006 are affected.

A flaw was found in postgresql-odbc. An untrusted database server can exploit this vulnerability to execute arbitrary code or cause a denial of service (DoS) on the client system. When cursor-based fetching is enabled, the driver determines its row cache size using the column count from the initial query result but fails to verify that subsequent fetch replies match this layout. By returning responses with mismatched column counts, a malicious server can cause a heap-based buffer overflow or integer underflow on the client.