CVE-2026-120061

psqlODBC ODBC escape parser stack buffer overflow

Published Nov 2, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
The psqlODBC parser for ODBC escape sequences in application SQL text writes the argument offsets of a {fn} escape into a fixed 16-entry stack array without a bound and does not initialize the array. An escape with too many arguments overflows the stack, and a reference to an unsupplied argument copies arbitrary bytes into the query. The copy of a {d}, {t}, {ts}, or {escape} body also writes one byte past a 128-byte stack buffer. An application that forwards untrusted SQL text to the driver exposes its process to memory corruption. Versions before psqlODBC 18.00.0006 are affected.

Analysis

AI-generated

Technical impact

The psqlODBC driver has a stack buffer overflow in the parser for ODBC escape sequences. The parser writes argument offsets for {fn} escapes into a 16‑entry array without bounds checks and does not initialize it. A payload with more than 16 arguments or a long escape body causes the array to overflow, copying arbitrary data into the query or overwriting executable code on the stack. Because this occurs in the driver that executes application SQL, the overflow can corrupt memory inside the database process, potentially leading to denial of service or, depending on the execution context, arbitrary code execution.

Affected Systems

Affected is the PostgreSQL psqlODBC driver: all releases prior to 18.00.0006. No other products are listed. Organizations using the driver in any version older than 18.00.0006 should treat the deployment as vulnerable.

Risk and Exploitability

A CVSS score of 7.5 indicates high severity. The EPSS score is not reported, and the vulnerability is not currently listed in the CISA KEV catalog. Attackers can exploit the flaw by injecting SQL that contains ODBC escape sequences with an excessive argument count or long body into an application that forwards the text to the driver. If the application runs with elevated privileges or the database process is exposed to a remote network, a successful overflow could permit remote code execution or, at minimum, denial of service.

Remediation

Vendor Solution

Upgrade to psqlODBC 18.00.0006 or later. The argument offset array is initialized and bounded, and the escape body copy reserves room for the terminator.


Vendor Workaround

Do not pass SQL text from untrusted sources to the driver, or reject text containing ODBC escape sequences ({fn ...}, {d ...}, {t ...}, {ts ...}, {escape ...}) before it reaches the driver.


OpenCVE Recommended Actions

  • Upgrade the psqlODBC driver to version 18.00.0006 or later.
  • Ensure that applications do not pass untrusted SQL text containing ODBC escape sequences to the driver; validate or reject such text before it reaches the driver.
  • If upgrading is not possible, modify the application to avoid using ODBC escape syntax and use parameterized queries instead.

Generated by OpenCVE AI on November 3, 2026 at 02:08 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 The psqlODBC parser for ODBC escape sequences in application SQL text writes the argument offsets of a {fn} escape into a fixed 16-entry stack array without a bound and does not initialize the array. An escape with too many arguments overflows the stack, and a reference to an unsupplied argument copies arbitrary bytes into the query. The copy of a {d}, {t}, {ts}, or {escape} body also writes one byte past a 128-byte stack buffer. An application that forwards untrusted SQL text to the driver exposes its process to memory corruption. Versions before psqlODBC 18.00.0006 are affected.
Title psqlODBC ODBC escape parser stack buffer overflow
Weaknesses CWE-121
CWE-193
CWE-457
References
Metrics cvssV3_1

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

Weaknesses

Sources

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