{"id":"CVE-2026-136509","aliases":["GHSA-98mx-57hv-xjpr"],"title":"Driver does not check that server replies match the queries it sent","originalDescription":"psqlODBC did not check that a server reply matches the query it sent: that a FETCH returns no more rows than it asked for, that each row has the described number of columns, that one query produces one result, and that a COPY, a transaction or the connection ends where the protocol says. By sending replies that do not match, a hostile or compromised server, or anyone on the network path of a connection that does not use sslmode=verify-full (the default is disable) can corrupt memory in the application:\n\n- A FETCH reply with more rows than requested overflows the row cache.\n- Extra results in reply to a FETCH, or to the queries of a keyset-driven cursor, are freed while still in use.\n- A key query of a keyset-driven cursor answered with extra columns, or a re-read row with fewer columns, overflows the row cache.\n- Replies without columns or rows, or with NULL values, to the driver's internal queries at connect time and in catalog functions are dereferenced.\n- A malformed relacl value in SQLTablePrivileges() makes the driver write past a buffer.\n- On Windows with MSDTC, a long transaction name returned by the server overflows a buffer during recovery.\n- Values in replies to the driver's internal queries are used without checking their range: an empty column name, a parameter count, a large-object size, a function's or trigger's argument count, and a result of exactly 32767 columns. They are dereferenced, read past, returned to the application or sent back to the server as stack memory, or make the driver loop forever.\n- A reply that ends a COPY, the connection or the transaction at an unexpected point leaves freed results, keysets or table information in use: a CopyOutResponse followed by a lost connection, a ROLLBACK command tag under UseDeclareFetch=1, or a lost connection while a cursor with positioned updates is closed. Eight extra bytes in a reply also make the driver wait forever for a COPY to end.\n- On Windows, a start-up reply without client_encoding crashes the driver, and with MSDTC a failed connection makes the XA library use a connection it has already freed.\n- An error message ending in the first byte of a multibyte character leaves the SQLSTATE returned by SQLGetDiagRecW() unterminated.\n- When a string value did not fit the application's buffer, eight Unicode entry points filled the buffer and wrote no null terminator, so a caller that reads to the terminator, as ODBC allows, read past the end of its own buffer.\n\nThis continues the fixes for CVE-2026-120058 and CVE-2026-120060, which covered other replies. The demonstrated results are crashes and heap corruption; code execution has not been demonstrated.\n\nVersions up to and including psqlODBC 18.00.0006 are affected.","severity":{"cvss":7.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","label":"high"},"exploitation":{"kev":null,"epss":{"score":0.00461,"percentile":0.31971},"exploitDb":null},"affected":[],"references":[{"url":"https://github.com/postgresql-interfaces/psqlodbc/security/advisories/GHSA-98mx-57hv-xjpr","type":"vendor-advisory"},{"url":"https://odbc.postgresql.org/changelog/","type":"release-notes"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/136xxx/CVE-2026-136509.json","type":"advisory"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-136509","type":"advisory"},{"url":"https://odbc.postgresql.org/","type":"web"}],"sources":[{"name":"nvd","at":"2026-11-25T23:44:28.078Z","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-136509","license":"NVD terms of use","firstSeenAt":"2026-11-25T23:44:28.078Z"},{"name":"osv","at":"2026-11-28T12:15:50.604Z","url":"https://osv.dev/vulnerability/CVE-2026-136509","license":"CC-BY 4.0","firstSeenAt":"2026-11-26T00:17:53.041Z"},{"name":"cvelistV5","at":"2026-11-28T22:07:49.066Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-136509","license":"CVE Terms of Use","firstSeenAt":"2026-11-25T22:36:00.369Z"}],"firstSeenAt":"2026-11-25T22:36:00.369Z","publishedAt":"2026-11-25T22:25:50.395Z","modifiedAt":"2026-11-28T10:27:22.477Z"}