CVE-2026-136506 in psqlODBCinfo

Summary

by MITRE • 11/26/2026

psqlODBC builds queries of its own from names, and put these names into them without escaping or qualification:

- the database name in SQLForeignKeys(); - the current schema name in catalog functions; - the table name in the currtid2() call that re-reads rows of updatable cursors; - column names in the inserts and updates of SQLSetPos() and SQLBulkOperations(); - cursor names set with SQLSetCursorName() or returned as refcursors (FetchRefcursors=1); - parameter names (SQL_DESC_NAME) in procedure calls; - the = operator in an OID comparison in SQLColumns(), which the server resolves through search_path.

The column names of the fourth item are a variant of CVE-2026-120065 (GHSA-9cg8-r57h-h6jj). The fix for that advisory, in 18.00.0006, doubles " in the stored row-identifier name, which the keyset queries and the WHERE clause of the positioned statements use. The column names that SQLSetPos() and SQLBulkOperations() put into the SET list of their UPDATE and into the column list of their SQL_ADD INSERT come from the catalog and were not covered by it, so a driver patched to 18.00.0006 is still affected by this one.

A database user who can create a database, schema, table, column or operator with a crafted name, or an end user who supplies a cursor or parameter name to the application, can run SQL with the rights of the application's database role.

Versions up to and including psqlODBC 18.00.0006 are affected.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 11/26/2026

The vulnerability in psqlODBC represents a critical injection flaw arising from insufficient input validation and sanitization when constructing SQL queries dynamically using identifiers provided by the application or end users. This issue affects versions up to and including 18.00.0006, where specific functions fail to escape or qualify database names, schema names, table names, column names, cursor names, parameter names, and operator symbols before embedding them into SQL statements sent to the PostgreSQL backend. The core technical flaw lies in the driver's reliance on raw identifier strings for catalog lookups and data manipulation operations without applying necessary quoting mechanisms that would prevent these identifiers from being interpreted as executable SQL syntax by the database server.

Specifically, the vulnerability manifests across multiple operational contexts within the ODBC driver. In the context of foreign key resolution via SQLForeignKeys(), the database name is inserted directly into queries without escaping, allowing an attacker who can create a maliciously named database to inject arbitrary commands during schema introspection operations. Similarly, catalog functions utilize the current schema name in query construction without proper qualification, exposing the application to injection attacks if the active schema has been crafted with special characters or SQL keywords that alter query logic. Furthermore, when handling updatable cursors, the driver employs a currtid2() call to re-read rows; here, table names are inserted into this function's arguments without escaping, creating an avenue for exploitation during cursor refresh operations.

The impact extends significantly to data modification and positioning functions such as SQLSetPos() and SQLBulkOperations(). These functions construct INSERT and UPDATE statements using column names retrieved from the database catalog. While a previous fix in version 18.00.0006 addressed similar injection risks related to row-identifier names by doubling double quotes, it failed to cover column names used in SET clauses for updates or column lists for SQL_ADD inserts. This oversight means that even patched versions remain vulnerable if an attacker can control the naming of columns within a table accessed through these bulk operations. Additionally, cursor names set via SQLSetCursorName() or returned as refcursors when FetchRefcursors is enabled are not sanitized, allowing injection during cursor management and fetching processes. Parameter names defined by SQL_DESC_NAME in procedure calls also lack proper escaping, enabling attackers to manipulate stored procedure execution logic through malicious parameter naming conventions.

A particularly subtle aspect of this vulnerability involves the OID comparison operator used within SQLColumns(). The driver utilizes an equals sign for object identifier comparisons, which the PostgreSQL server resolves using its search_path configuration. If a user can create a custom operator with the name equal to or resembling standard operators and place it in the search path, they may alter the behavior of column metadata retrieval queries, potentially leading to information disclosure or logic bypasses depending on how the backend interprets the ambiguous reference.

The operational impact is severe because any database user who possesses privileges to create databases, schemas, tables, columns, or custom operators can exploit this flaw by crafting identifiers containing SQL injection payloads. Alternatively, end users interacting with applications built on psqlODBC may supply malicious cursor names or parameter values that get embedded into backend queries without validation. Consequently, an attacker can execute arbitrary SQL commands with the privileges of the application's database role, potentially leading to unauthorized data access, modification, deletion, or complete system compromise depending on the permissions granted to that specific database user account.

This vulnerability aligns closely with CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection) and maps to MITRE ATT&CK techniques such as T1059.004: Command and Scripting Interpreter: SQL Commands, where attackers leverage injection points within database queries to execute unintended commands. The failure to properly quote identifiers distinguishes this from standard value-based injections, highlighting a systemic issue in how the driver handles metadata-driven query construction rather than just user-supplied data values.

Mitigation strategies must prioritize upgrading psqlODBC to versions released after 18.00.0006 where comprehensive fixes for identifier escaping have been implemented across all affected functions including SQLSetPos(), SQLBulkOperations(), and catalog introspection routines. In the interim, application developers should enforce strict naming conventions that prohibit special characters in database objects such as tables, columns, schemas, and databases to minimize the attack surface. Additionally, implementing least-privilege principles for the database accounts used by ODBC applications can limit the potential impact of successful injection attempts by restricting permissions related to object creation or modification within the PostgreSQL environment.

Responsible

PostgreSQL

Reservation

11/24/2026

Disclosure

11/26/2026

Moderation

accepted

CPE

ready

EPSS

0.00451

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!