CVE-2026-136499 in psqlODBC
Summary
by MITRE • 11/26/2026
psqlODBC read memory it had not written, or memory past the end of an application buffer, and sent it to the server or returned it to the application:
- Text bound as SQL_C_CHAR to a large-object parameter was read past the end of the application's buffer, and the extra bytes were stored in the large object. - After a fetch truncated a long bytea or large-object value, positioned updates and inserts read past the bound buffer and wrote that memory into the row. - Hex text with a NUL byte, bound to a binary parameter with an explicit length, sent uninitialised heap memory as the parameter value. - With RowVersioning=1, SQLColumns() on a table that does not exist returned uninitialised stack memory as the schema and table names. - With UseDeclareFetch=1, bookmarks of updatable block cursors contained uninitialised heap memory, and a malformed ctid from the server sent stale heap bytes in positioned updates and deletes. - With UseServerSidePrepare=0, calling SQLNumResultCols(), SQLDescribeCol() or SQLColAttribute() on a prepared statement before SQLExecute() read the application's bound parameter buffers and sent their current contents to the server as literals, although ODBC lets the application fill those buffers after the describe. - The driver named the prepared statements, savepoints, cursors and keyset plans it creates on the server after the heap addresses of its own objects, so the server, or anyone reading an unencrypted connection, learned exact heap addresses inside the client.
Depending on the case, an end user who supplies a parameter value, a database user who stores a long value in a row, or a hostile server can obtain memory of the application process, which may hold data of other users or credentials.
Versions up to and including psqlODBC 18.00.0006 are affected.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 11/26/2026
The vulnerability identified within psqlODBC represents a critical class of information disclosure flaws rooted in improper memory management, specifically involving the reading of uninitialized heap or stack memory and buffer over-reads during data binding and retrieval operations. This issue affects versions up to and including 18.00.0006, where multiple distinct code paths fail to properly validate buffer boundaries or initialize allocated memory before transmission to the PostgreSQL server or return to the calling application. The core technical flaw lies in the driver's handling of large objects, binary parameters, and metadata queries, where it fails to ensure that only valid, initialized data is processed. For instance, when text bound as SQL_C_CHAR to a large-object parameter exceeds the length of the application's buffer, the driver reads past the end of this buffer, capturing adjacent memory contents which are then erroneously stored within the large object on the database server. Similarly, during fetch operations that truncate long bytea or large-object values, positioned updates and inserts proceed to read beyond the bound buffer limits, writing uninitialised heap memory into the row data rather than limiting the write to the actual valid content length.
Further exacerbating the risk is the handling of binary parameters with explicit lengths containing hex text with NUL bytes. In these scenarios, the driver transmits uninitialised heap memory as part of the parameter value to the server, effectively leaking internal application state that may contain sensitive credentials or data belonging to other users. The vulnerability extends into metadata retrieval functions such as SQLColumns when RowVersioning is enabled; if a query targets a non-existent table, the function returns uninitialised stack memory for schema and table names rather than an error code indicating the object's absence. This behavior allows attackers to probe internal memory structures through standard database interaction APIs. Additionally, cursor management features exhibit similar deficiencies. With UseDeclareFetch enabled, bookmarks associated with updatable block cursors contain uninitialised heap memory, while malformed ctid values received from the server can trigger positioned updates and deletes that write stale heap bytes into the result set or transaction state.
The impact of these vulnerabilities is severe, as they facilitate arbitrary information disclosure across multiple attack vectors involving end users supplying parameter values, database users storing long values, or even a hostile server exploiting malformed responses to read client-side memory. The leakage of uninitialised memory can expose sensitive data such as authentication tokens, session keys, or proprietary application logic residing in adjacent memory blocks. A particularly concerning aspect of this vulnerability profile is the driver's naming convention for internal database objects like prepared statements, savepoints, cursors, and keyset plans. By embedding heap addresses into these names, psqlODBC inadvertently leaks exact memory layout information to the server side. If an attacker can observe unencrypted connections or access server-side logs, they gain precise knowledge of the client's heap structure, which significantly aids in crafting further exploits such as return-oriented programming attacks against the application process itself.
From a classification perspective, these issues align closely with CWE-125 Out-of-bounds Read and CWE-908 Use of Uninitialized Resource, reflecting both the boundary violation during data transfer and the failure to properly initialize memory before use. In terms of adversarial tactics, this vulnerability supports ATT&CK technique T1074 Data Staged or Local Data Dumping if used for staging leaked information, but more accurately maps to T1539 Steal Web Session Cookie when session tokens are exposed via buffer over-reads, and potentially aids in T1068 Exploitation for Privilege Escalation by providing memory layout details necessary for advanced exploitation techniques. Mitigation strategies must prioritize immediate patching to the latest stable version of psqlODBC where these bounds checks and initializations have been corrected. For environments unable to upgrade immediately, network-level controls such as enforcing TLS encryption can mitigate the risk associated with heap address leakage over unencrypted connections. Furthermore, application developers should implement strict input validation on parameter lengths and avoid relying on ODBC functions for metadata retrieval in contexts involving potentially non-existent objects without robust error handling that prevents memory exposure through exception paths or default return values.