CVE-2026-136509: psqlODBC trusts server replies that do not match the queries it sent

ByLinuxtastic

November 30, 2026 #CVE, #psqlODBC

psqlODBC did not check that what the server sent back matched what it had asked for: that a FETCH returns no more rows than requested, that each row has the described number of columns, that one query yields one result, or that a COPY, a transaction or the connection ends where the protocol says it should. In every release up to and including 18.00.0006 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 send replies that do not match and corrupt memory in the application: an oversized FETCH reply overflows the row cache, extra results are freed while still in use, replies without columns are dereferenced, and a connection cut at the wrong moment leaves freed results and keysets in use. Upgrade psqlODBC to 18.00.0007 or later (18.00.0008 is current) and restart every process that has the driver loaded; until then connect with sslmode=verify-full to a trusted server. It is one of seventeen psqlODBC CVEs fixed in that release.

CVE-2026-136509 at a glance.

ComponentpsqlODBC, the PostgreSQL ODBC driver: the reply handling for FETCH, keyset-driven cursors, the driver’s internal queries at connect time and in catalogue functions, SQLTablePrivileges(), COPY and transaction end, the eight Unicode entry points that return string values, and (on Windows) MSDTC recovery and start-up; packaged as odbc-postgresql (Debian/Ubuntu), postgresql-odbc (RHEL), psqlODBC (SUSE)
Affected versionsevery psqlODBC release up to and including 18.00.0006; the distribution packages of 13.02, 17.00 and 18.00.0006 in the table below are all affected
Fixed inpsqlODBC 18.00.0007 (the advisory’s patched version); 18.00.0008 is the current release and fixes three further CVEs. The advisory is dated 25 November 2026; the changelog prints no release dates
SeverityPostgreSQL (CNA) CVSS 3.1 7.5 High (AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H), the same on GHSA-98mx-57hv-xjpr; NVD Received with the CNA’s vector; SUSE important, 7.5, and a CVSS 4.0 of 7.7. CWE-787 (out-of-bounds write), CWE-416 (use after free) and CWE-476 (NULL dereference). Crashes and heap corruption demonstrated; code execution not. The record says it “continues the fixes for CVE-2026-120058 and CVE-2026-120060”
Exploited in the wildNot on CISA’s Known Exploited Vulnerabilities list as of 1 December 2026 (catalogue 2026.11.27). EPSS 0.0046 (32nd percentile) on 30 November 2026
Who is exposedevery application that connects through psqlODBC to a server it does not control, and every application whose connection crosses a network it does not trust without sslmode=verify-full, which is the common case because the driver’s default is disable and most DSNs never set it. The attacker is the server or a machine in the middle, not a database user, so an application with a verified connection to a server you run is not on this path except for the unterminated-string case in the Unicode entry points, which needs only a value that does not fit the application’s buffer
PublishedCVE record 25 November 2026 (PostgreSQL CNA); this page built 1 December 2026, last updated 1 December 2026

What it is

A client library has two sources of truth about a result: what it asked for and what the server says. psqlODBC used the second without checking it against the first. The record’s list is long and each item is the same shape. “A FETCH reply with more rows than requested overflows the row cache.” “Extra results in reply to a FETCH, or to the queries of a keyset-driven cursor, are freed while still in use.” “A key query of a keyset-driven cursor answered with extra columns, or a re-read row with fewer columns, overflows the row cache.” “Replies without columns or rows, or with NULL values, to the driver’s internal queries at connect time and in catalog functions are dereferenced.” A malformed relacl value in SQLTablePrivileges() makes the driver write past a buffer, and values in replies to the internal queries, “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”, are used without range checks and “are dereferenced, read past, returned to the application or sent back to the server as stack memory, or make the driver loop forever”.

The protocol-state cases are the subtle ones. “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”. Two Windows-only items (a start-up reply without client_encoding, and MSDTC using a freed connection) do not apply to Linux, but the last one does everywhere: 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”. The record names its attacker plainly: “a hostile or compromised server, or anyone on the network path of a connection that does not use sslmode=verify-full“.

This is one of seventeen psqlODBC advisories published together on 25 November 2026 and fixed in 18.00.0007; each credits “an automated scan with the OSS Scanner (scan psqlodbc-20261105-004)”. This one is the protocol-trust entry and the direct successor of CVE-2026-120058 and CVE-2026-120060 from the October set; its sibling CVE-2026-136512 covers type mismatches in the same replies, and CVE-2026-136503 the clean-up those replies can re-enter. The five siblings written up alongside this page are CVE-2026-136503, CVE-2026-136505, CVE-2026-136506, CVE-2026-136512, CVE-2026-136515; the earlier three, CVE-2026-136500, CVE-2026-136502 and CVE-2026-136507, are injection flaws in the driver’s reading of statement text and the connection string. On 1 December 2026 only Debian sid and openSUSE Tumbleweed ship the fix as a package; every stable release we could read is still on an affected version with no advisory.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 1 December 2026; the link in the row is the tracker page, which will be newer than this one.

DistributionStatusFixed package
AlpineTracker refused our reader on 1 December 2026—
DebianVulnerable in bookworm (1:13.02.0000-2), trixie (1:17.00.0004-2) and forky (1:18.00.0006-1); fixed in sid; no DSA or DLAsid psqlodbc 1:18.00.0007-2
Ubuntumedium; the psqlodbc source package is needs-triage on every release from 16.04 to 26.10 (last updated 30 November)nothing on 1 December 2026; odbc-postgresql at 18.00.0007 or later is the version to look for
RHEL, Rocky, Alma, CentOS StreamSecurity-data feed refused our reader on 1 December 2026not read; the package is postgresql-odbc
openSUSE/SLEimportant, SUSE’s own score 7.5 (AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H) against the CNA’s 7.5, Pending (bug 1292049); Affected on SLE 15 SP7, the LTSS and ESPOS lines and Leap 15.3–15.6; released for TumbleweedTumbleweed psqlODBC 18.00.0007-1.1 (openSUSE-Tumbleweed-2026-12716); nothing for SLE on 1 December 2026
Fedora, Arch; source builds and vendor-bundled driversNot consulted; upstream fixed versions applypsqlODBC 18.00.0007 or 18.00.0008

How to check

Two questions settle most hosts: which driver is installed, and which running processes have it mapped. Then one question decides the exposure: does every connection verify the server. A DSN without sslmode uses disable, and require encrypts without authenticating, so only verify-full (or verify-ca against a private CA) takes the network out of the picture.

# 1. which psqlODBC is installed, and which driver files the ODBC manager knows about
dpkg -l odbc-postgresql 2>/dev/null | awk '/^ii/{print $2, $3}'; rpm -q postgresql-odbc psqlODBC 2>/dev/null
odbcinst -q -d
for f in $(grep -rhoE '^Driver\s*=\s*\S+psqlodbc\S*' /etc/odbcinst.ini 2>/dev/null | awk -F= '{print $2}'); do
  echo "$f: $(strings "$f" 2>/dev/null | grep -m1 -E '^[0-9]{2}\.[0-9]{2}\.[0-9]{4}$')"; done

# 2. which processes have the driver mapped right now (these are the ones that need a restart)
for p in $(sudo grep -l psqlodbc /proc/[0-9]*/maps 2>/dev/null | cut -d/ -f3); do ps -o pid,user,comm= -p "$p"; done

# 3. is the server verified on every DSN and every connection string the application builds?
grep -niE '^(sslmode|sslrootcert)\s*=' /etc/odbc.ini ~/.odbc.ini 2>/dev/null
grep -rnoiE 'sslmode=[a-z-]+' /opt /srv 2>/dev/null | sort -u | head
# from the server's side: which ODBC sessions arrived without TLS at all
psql -Atc "select a.usename, a.client_addr, a.application_name, s.ssl from pg_stat_activity a join pg_stat_ssl s on s.pid=a.pid where a.application_name ilike '%odbc%';"

A driver file reporting 18.00.0007 or 18.00.0008, or a distribution package at or above the version in the table, is fixed. Anything older is affected, and if step 3 finds a DSN with no sslmode or anything short of verify-full, every machine between the application and the server can answer its queries however it likes. A verified connection to your own server leaves the unterminated-string case, which is a bug in the application’s favour only if the application never reads to the terminator.

How to fix it

Upgrade to psqlODBC 18.00.0007 or later and restart every process that has the driver loaded; a shared library already mapped into a long-running application server, ETL daemon or reporting service keeps the old code until that process exits. On a stable release the choice on 1 December 2026 is a backport, a build from source, or the mitigation below until the distribution catches up.

# Debian sid (and trixie/bookworm once a DSA lands) / Ubuntu once a USN lands
apt update && apt install --only-upgrade odbc-postgresql
# RHEL family, once an erratum lands
dnf upgrade postgresql-odbc
# openSUSE Tumbleweed (SLE: nothing yet)
zypper patch
# from source: 18.00.0008 is the current release; the tarballs live under https://ftp.postgresql.org/pub/odbc/releases/
tar xzf psqlodbc-18.00.0008.tar.gz && cd psqlodbc-18.00.0008 && ./configure --with-unixodbc && make && sudo make install
# then restart every process from step 2 of the check

Until the upgrade, the advisory’s one-line workaround is the whole answer: “Connect with sslmode=verify-full to a trusted server.” That needs the CA that signed the server’s certificate on the client, named in sslrootcert, and a server certificate whose name matches what the client connects to. What not to do: sslmode=require looks like the same setting and is not, because it accepts any certificate, including one a machine in the middle made up; and a firewall rule that only lets the application reach the real server’s address does not help against a compromised server, which is the other half of the record’s threat model.

# mitigation: verify the server on every DSN (the CA that signed the server certificate must be on the client)
sed -i -E 's/^(sslmode\s*=).*/\1 verify-full/' /etc/odbc.ini
grep -q '^sslmode' /etc/odbc.ini || printf 'sslmode = verify-full\nsslrootcert = /etc/ssl/certs/pg-ca.pem\n' >> /etc/odbc.ini
isql -v mydsn myuser 2>&1 | head -3           # must still connect; a name mismatch fails here, which is the point

Sources

  • CVE-2026-136509 at CVE.org — the PostgreSQL CNA record (25 November 2026): the itemised description, affected 0 to and including 18.00.0006, CVSS 3.1 7.5, CWE-787, CWE-416 and CWE-476
  • GHSA-98mx-57hv-xjpr — the vendor advisory (published 25 November 2026 by davecramer): patched version 18.00.0007, the one-line workaround, the note that it continues CVE-2026-120058 and CVE-2026-120060, and the OSS Scanner credit; no commit or file is named; psqlODBC changelog, whose 18.00.0007 entry lists this CVE among seventeen and whose 18.00.0008 entry adds three more (no release dates printed)
  • NVD entry — Received (published 25 November 2026), carrying the CNA’s vector and CWEs as a secondary metric; no NVD score or CPEs
  • Distribution trackers: Debian (sid fixed, no DSA) · Ubuntu (medium, needs-triage) · Red Hat (refused on 1 December) · SUSE (Pending, Tumbleweed released) · Alpine (refused on 1 December)
  • CISA KEV catalogue 2026.11.27, not listed · EPSS 0.0046 (32nd percentile) for this CVE, 30 November 2026

Related reading

  • CVE-2026-136503: psqlODBC frees transaction clean-up state twice and writes past application buffers (cve-2026-136503-psqlodbc-cleanup-use-after-free, forthcoming) — a sibling from the same 25 November set, fixed in the same release
  • CVE-2026-136505: psqlODBC lets unchecked sizes and 16-bit counters overflow its buffers (cve-2026-136505-psqlodbc-counter-overflows, forthcoming) — a sibling from the same 25 November set, fixed in the same release
  • CVE-2026-136506: psqlODBC runs SQL hidden in object names it copies into its own queries (cve-2026-136506-psqlodbc-catalog-name-injection, forthcoming) — a sibling from the same 25 November set, fixed in the same release
  • CVE-2026-136507: psqlODBC lets a user-supplied password end the connection string early and set other keywords — the sibling with the clearest workaround: injection through the connection string rather than through the driver’s own queries
  • Running PostgreSQL Properly: A Transaction’s Path to Durability — what the driver is talking to, and where sslmode, roles and search_path fit in
  • The Half of Patching That Happens After the Patch is Installed — why a replaced shared library does nothing until the process that mapped it restarts

This advisory page was assembled from the primary sources listed above on 1 December 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.