CVE-2026-120058

psqlODBC row cache overflow when a later FETCH changes the column count

Published Nov 2, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

psqlODBC allocates its row cache based on the column count of the first FETCH of a cursor. Later FETCH replies are used to recompute the column count without any validation. If an attacker can cause a cursor to return a later FETCH with a different count, the driver will overrun or underflow its allocated heap buffer, potentially corrupting memory and enabling arbitrary code execution. This vulnerability is reachable when UseDeclareFetch is enabled and the server is not trusted by the current SSL configuration, allowing the attacker to supply tailored responses.

Affected Systems

The affected product is psqlODBC from PostgreSQL, with versions prior to 18.00.0006 vulnerable. The issue is limited to these older releases; newer releases contain a guard that rejects mismatched column counts and mitigates keyset replies with fewer columns than key fields.

Risk and Exploitability

The CVSS score of 7.5 indicates a high severity, but the EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog, suggesting a lower probability of widespread exploitation. Exploitation requires an attacker who can influence the server’s responses, typical of untrusted or improperly secured database connections, and the cursor must be fetched with UseDeclareFetch enabled. If these conditions are met, the memory corruption could allow the attacker to execute arbitrary code on the client machine.

Remediation

Vendor Solution

Upgrade to psqlODBC 18.00.0006 or later. The driver rejects a column count that changes between fetches of the same cursor, and a keyset reply with fewer columns than the key fields.


Vendor Workaround

Set UseDeclareFetch=0, or connect only to servers authenticated with sslmode=verify-full or an equivalent GSS setting.


OpenCVE Recommended Actions

  • Upgrade psqlODBC to version 18.00.0006 or later.
  • Set UseDeclareFetch=0 to disable the vulnerable fetching mode.
  • Ensure connections use SSL with verify-full or an equivalent GSS setting to reduce the ability for an untrusted server to supply malicious FETCH replies.

Generated by OpenCVE AI on November 2, 2026 at 20:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Postgresql
Postgresql psqlodbc
Vendors & Products Postgresql
Postgresql psqlodbc
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title psqlODBC row cache overflow when a later FETCH changes the column count
Weaknesses CWE-191
CWE-787
References
Metrics cvssV3_1

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

Weaknesses
  • CWE-191

    Integer Underflow (Wrap or Wraparound)

  • CWE-787

    Out-of-bounds Write

Sources

Status
PUBLISHED
Assigner
PostgreSQL
Published
Updated
Nov 2, 2026, 7:33 PM
Reserved
Oct 30, 2026, 7:25 PM
Status
Awaiting Analysis
Published
Nov 2, 2026, 7:18 PM
Modified
Nov 2, 2026, 8:17 PM
Severity
Important
Public date
Nov 2, 2026, 7:09 PM