CVE-2026-120067

psqlODBC stack buffer overflow copying ctid and oid values for updatable cursors

Published Nov 2, 2026 CVSS 3.1 · 5.9 Medium EPSS < 1% KEV · Not listed
Description
For updatable cursors, which are enabled by default, psqlODBC adds hidden ctid and, for tables with OIDs, oid columns to the query. It copies each value into a 32-byte stack buffer using the length the server sent, without checking it against the buffer size, so a value of 32 bytes or more writes past the buffer. A server not trusted under current SSL settings can send such a value. So can any database user who can create a view with its own column named ctid that the application reads with an updatable cursor. Builds with _FORTIFY_SOURCE abort; other builds overwrite adjacent stack memory. Versions before psqlODBC 18.00.0006 are affected.

Analysis

AI-generated

Technical impact

The vulnerability exists in psqlODBC when handling updatable cursors. The driver appends hidden ctid and, when applicable, oid columns to the SELECT statement, then copies the values into a fixed 32‑byte stack buffer using the length reported by the server. Because the length is not verified against the buffer capacity, values of 32 bytes or more overflow the stack. In builds where _FORTIFY_SOURCE is enabled, the overflow causes an abort that results in a crash; other builds overwrite adjacent stack memory, which could potentially allow an attacker to manipulate program control flow. The flaw is a classic stack buffer overflow, classified as CWE‑121 and CWE‑787.

Affected Systems

PostgreSQL clients that use the open source psqlODBC driver, specifically any deployment of psqlODBC prior to version 18.00.0006. This includes all PostgreSQL:psqlODBC installations where the driver is configured to use updatable cursors, which is the default setting.

Risk and Exploitability

The risk assessment shows a CVSS score of 5.9, indicating medium severity. The EPSS score is not available, and the vulnerability is not listed in CISA KEV. Attackers can exploit the flaw by sending a maliciously constructed ctid value via an untrusted database connection or by creating a view that defines its own ctid column and then accessing it with an updatable cursor. The condition of the attack requires the driver to be using updatable cursors, which is enabled by default, but can be disabled through configuration. The vulnerability could lead to application crashes or, depending on the environment, a loss of trust and potential privilege escalation.

Remediation

Vendor Solution

Upgrade to psqlODBC 18.00.0006 or later. The driver rejects a keyset value that does not fit its buffer, and the query fails with SQLSTATE HY000.


Vendor Workaround

Set UpdatableCursors=0 in the connection string or DSN, so the driver does not add the keyset columns.


OpenCVE Recommended Actions

  • Upgrade psqlODBC to version 18.00.0006 or later, ensuring the driver rejects oversized keyset values and the query fails with SQLSTATE HY000.
  • Set UpdatableCursors=0 in the database connection string or DSN to prevent the driver from adding ctid and oid columns, eliminating the buffer overflow path.
  • For environments that cannot immediately upgrade, review SSL configuration to restrict untrusted servers and monitor for abnormal ctid or oid values that exceed 31 bytes, as such values indicate an attempt to trigger the overflow.

Generated by OpenCVE AI on November 2, 2026 at 21:50 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': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description For updatable cursors, which are enabled by default, psqlODBC adds hidden ctid and, for tables with OIDs, oid columns to the query. It copies each value into a 32-byte stack buffer using the length the server sent, without checking it against the buffer size, so a value of 32 bytes or more writes past the buffer. A server not trusted under current SSL settings can send such a value. So can any database user who can create a view with its own column named ctid that the application reads with an updatable cursor. Builds with _FORTIFY_SOURCE abort; other builds overwrite adjacent stack memory. Versions before psqlODBC 18.00.0006 are affected.
Title psqlODBC stack buffer overflow copying ctid and oid values for updatable cursors
Weaknesses CWE-121
CWE-787
References
Metrics cvssV3_1

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

Weaknesses

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
Moderate
Public date
Nov 2, 2026, 7:09 PM