psqlODBC rewrites statement text for keyset-driven cursors and ODBC escapes using positions it found in the text. These positions could lie outside the text or describe another statement:
- After SQLExecDirect() failed on a statement handle, the FROM and WHERE positions of the failed statement were applied to the next, shorter statement on that handle.
- The parser could record a FROM position with no text after it, and the rewrite then copied a negative length.
- An {fn …} escape whose arguments contain FOR UPDATE, ; or INTO … FROM made the driver remove a cursor prefix from the wrong buffer.
- {fn CONVERT(?, …)} with an output parameter produced a negative argument length.
- An unclosed {fn …} escape made the driver read past the statement, and a few thousand nested ones exhausted the stack.
- Translating @@identity in long statement text read an uninitialised pointer, and {? = call …} with nothing bound for the return value dereferenced NULL.
Whoever supplies the text of a statement that an application opens on a keyset-driven or dynamic cursor with a concurrency other than read-only, or calls with an output parameter, can corrupt the application's heap and end it. That includes the users of query tools, report builders and other applications that run SQL their users type. Code execution has not been demonstrated.
Versions up to and including psqlODBC 18.00.0006 are affected.
- After SQLExecDirect() failed on a statement handle, the FROM and WHERE positions of the failed statement were applied to the next, shorter statement on that handle.
- The parser could record a FROM position with no text after it, and the rewrite then copied a negative length.
- An {fn …} escape whose arguments contain FOR UPDATE, ; or INTO … FROM made the driver remove a cursor prefix from the wrong buffer.
- {fn CONVERT(?, …)} with an output parameter produced a negative argument length.
- An unclosed {fn …} escape made the driver read past the statement, and a few thousand nested ones exhausted the stack.
- Translating @@identity in long statement text read an uninitialised pointer, and {? = call …} with nothing bound for the return value dereferenced NULL.
Whoever supplies the text of a statement that an application opens on a keyset-driven or dynamic cursor with a concurrency other than read-only, or calls with an output parameter, can corrupt the application's heap and end it. That includes the users of query tools, report builders and other applications that run SQL their users type. Code execution has not been demonstrated.
Versions up to and including psqlODBC 18.00.0006 are affected.
Advisories
No advisories yet.
Fixes
Solution
No solution given by the vendor.
Workaround
No workaround given by the vendor.
References
History
Thu, 26 Nov 2026 00:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Postgresql
Postgresql psqlodbc |
|
| Vendors & Products |
Postgresql
Postgresql psqlodbc |
Wed, 25 Nov 2026 22:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Description | psqlODBC rewrites statement text for keyset-driven cursors and ODBC escapes using positions it found in the text. These positions could lie outside the text or describe another statement: - After SQLExecDirect() failed on a statement handle, the FROM and WHERE positions of the failed statement were applied to the next, shorter statement on that handle. - The parser could record a FROM position with no text after it, and the rewrite then copied a negative length. - An {fn …} escape whose arguments contain FOR UPDATE, ; or INTO … FROM made the driver remove a cursor prefix from the wrong buffer. - {fn CONVERT(?, …)} with an output parameter produced a negative argument length. - An unclosed {fn …} escape made the driver read past the statement, and a few thousand nested ones exhausted the stack. - Translating @@identity in long statement text read an uninitialised pointer, and {? = call …} with nothing bound for the return value dereferenced NULL. Whoever supplies the text of a statement that an application opens on a keyset-driven or dynamic cursor with a concurrency other than read-only, or calls with an output parameter, can corrupt the application's heap and end it. That includes the users of query tools, report builders and other applications that run SQL their users type. Code execution has not been demonstrated. Versions up to and including psqlODBC 18.00.0006 are affected. | |
| Title | Memory corruption and crashes when the driver rewrites statements for cursors and escapes | |
| Weaknesses | CWE-125 CWE-674 CWE-787 |
|
| References |
| |
| Metrics |
cvssV3_1
|
Projects
Sign in to view the affected projects.
Status: PUBLISHED
Assigner: PostgreSQL
Published:
Updated: 2026-11-25T22:25:54.130Z
Reserved: 2026-11-24T20:17:10.905Z
Link: CVE-2026-136515
No data.
Status : Received
Published: 2026-11-25T23:17:24.887
Modified: 2026-11-25T23:17:24.887
Link: CVE-2026-136515
No data.
OpenCVE Enrichment
Updated: 2026-11-26T10:30:21Z