CVE-2026-120063

psqlODBC stack buffer overflow when quoting long schema and table names

Published Nov 2, 2026 CVSS 3.1 · 5.9 Medium EPSS < 1% KEV · Not listed
Description
When psqlODBC quotes a schema or table name into a 128-byte stack buffer, its length check lets it write up to two bytes past the end of the buffer for a long name. The names come from the application's SQL text: the table of a statement the driver parses to describe its columns, and the target of the last INSERT when the driver rewrites SELECT @@IDENTITY. In the @@IDENTITY rewrite, a column name sent by the server can also write one byte past the buffer. The bytes written past the buffer are a double quote and a NUL. An application that forwards untrusted SQL text to the driver exposes its process to stack corruption. Versions before psqlODBC 18.00.0006 are affected.

Analysis

AI-generated

Technical impact

A buffer overrun occurs when psqlODBC quotes a schema or table name into a fixed 128‑byte stack buffer. If the identifier is longer, the driver writes a double quote and a NUL character past the buffer boundary, corrupting the stack. This memory corruption could enable an attacker controlling untrusted SQL text to compromise the process or gain privileges. This flaw is a classic stack buffer overflow (CWE‑121).

Affected Systems

PostgreSQL psqlODBC prior to 18.00.0006 is affected. Any application that uses the ODBC driver to send SQL text containing long schema or table names, especially those sourced from untrusted inputs, is vulnerable. No specific operating system or platform is mentioned, so the impact applies to all environments where the driver is installed.

Risk and Exploitability

The CVSS score is 5.9, indicating moderate severity. The EPSS score is not available, and the vulnerability is not listed in CISA's KEV catalog, suggesting it is not actively exploited in the wild yet. Likely attack vectors involve an application forwarding malicious SQL from an external source to the driver; if the attacker supplies a long schema or table name, the stack corruption can be triggered. Because the overflow writes only a few bytes, exploitation would require additional techniques to turn the corruption into code execution, so the risk is moderate but non‑negligible.

Remediation

Vendor Solution

Upgrade to psqlODBC 18.00.0006 or later. identifierEscape bounds every write to the output buffer, including the closing quote and the terminator.


Vendor Workaround

Do not pass SQL text from untrusted sources to the driver.


OpenCVE Recommended Actions

  • Upgrade psqlODBC to version 18.00.0006 or later.
  • Ensure that all SQL statements sent to the driver are generated internally and do not include untrusted user input; sanitize or parameterize queries to remove arbitrary schema or table names.
  • Review application code for any usage of dynamic SQL that could include long identifiers and refactor to use safe ODBC interfaces or validated inputs.

Generated by OpenCVE AI on November 2, 2026 at 20:37 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 When psqlODBC quotes a schema or table name into a 128-byte stack buffer, its length check lets it write up to two bytes past the end of the buffer for a long name. The names come from the application's SQL text: the table of a statement the driver parses to describe its columns, and the target of the last INSERT when the driver rewrites SELECT @@IDENTITY. In the @@IDENTITY rewrite, a column name sent by the server can also write one byte past the buffer. The bytes written past the buffer are a double quote and a NUL. An application that forwards untrusted SQL text to the driver exposes its process to stack corruption. Versions before psqlODBC 18.00.0006 are affected.
Title psqlODBC stack buffer overflow when quoting long schema and table names
Weaknesses CWE-121
CWE-787
References
Metrics cvssV3_1

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

Weaknesses

Sources

Status
PUBLISHED
Assigner
PostgreSQL
Published
Updated
Nov 2, 2026, 7:36 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