psqlODBC, the PostgreSQL ODBC driver, runs housekeeping queries of its own when an application commits or rolls back, and in every release up to and including 18.00.0006 the reply to one of those queries could start the same clean-up again while it was still running; the nested run freed the rollback log, or the list of cursors and prepared statements waiting to be closed, and the outer run then used and freed it a second time. The same advisory collects seven further cases where a result or a statement is freed while still referenced or an offset lands past the buffer the application passed, several of them reachable from a hostile server or from anyone on the network path of a connection that does not verify the server. 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 and do not use UseDeclareFetch=1 with updatable cursors. It is one of seventeen psqlODBC CVEs fixed in that release.
CVE-2026-136503 at a glance.
| Component | psqlODBC, the PostgreSQL ODBC driver: the clean-up it runs at commit and rollback, the libpq notice callback, statement and result freeing with FetchRefcursors=1 or UseDeclareFetch=1, SQLGetData() after a failed multi-row fetch, SQLProcedureColumns(), and the data-at-execution path of SQLSetPos() and SQLBulkOperations(); packaged as odbc-postgresql (Debian/Ubuntu), postgresql-odbc (RHEL), psqlODBC (SUSE) |
| Affected versions | every 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 in | psqlODBC 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 |
| Severity | PostgreSQL (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-48v4-hjc5-hx8w; NVD Received with the CNA’s vector; SUSE moderate and scores it 5.9 (C:N/I:L/A:H). CWE-416 (use after free), CWE-415 (double free) and CWE-787 (out-of-bounds write). The record says crashes and heap corruption were demonstrated and code execution was not |
| Exploited in the wild | Not on CISA’s Known Exploited Vulnerabilities list as of 1 December 2026 (catalogue 2026.11.27). EPSS 0.0057 (41st percentile) on 30 November 2026 |
| Who is exposed | applications that connect through psqlODBC to a server they do not control, or over a path they do not trust, without sslmode=verify-full (the driver’s default is disable): a hostile or compromised server, or a machine in the middle, triggers most of the cases. Two cases need only an ordinary database user: one who can make a statement fail, or who controls the contents of a row the application reads, reaches the UseDeclareFetch=1 and SQLGetData() cases against an honest server. Applications that use neither UseDeclareFetch nor FetchRefcursors and verify their server are left with the clean-up re-entry case, which still needs a server reply the driver did not expect |
| Published | CVE record 25 November 2026 (PostgreSQL CNA); this page built 1 December 2026, last updated 1 December 2026 |
What it is
The record itemises eight defects, and the thread through them is the driver trusting that the thing it is about to free is no longer in use. At commit and rollback psqlODBC sends queries of its own to close cursors and prepared statements, and “the reply to one of them can start the clean-up again while it is running”; the nested run frees the rollback log or the pending-close list, “and the outer run uses and frees it again”. The callback through which libpq delivers server notices could run that same clean-up, and close the connection, “while libpq was still using the connection”. A statement whose result holds several cursors (FetchRefcursors=1 or UseDeclareFetch=1) “used the freed first result while the later cursors were closed”, and with UseDeclareFetch=1 a rollback that closed an updatable cursor left rows that were counted but never stored, “so freeing the statement freed uninitialised pointers, and adding a row wrote past the keyset”.
The remaining four are smaller and more local: SQLGetData() after a multi-row fetch failed on a row other than the first “wrote at an offset past the buffer the application passed”; SQLProcedureColumns() freed its catalog result twice when the query failed; in a process named sqlservr, a server version below 8.4 made the parser free a buffer twice; and a failed SQLPutData in the middle of a positioned update left the whole operation pending with autocommit silently off, so later statements were rolled back at disconnect and the next positioned update “dereferenced NULL”. The record is explicit about who can reach what: “most of these can be triggered by a hostile or compromised server, or anyone on the network path of a connection that does not use sslmode=verify-full“, while “a database user who can make a statement fail, or who controls the contents of a row the application reads” can trigger the UseDeclareFetch=1 and SQLGetData() cases against an honest server.
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 memory-safety entry for the driver’s result and transaction clean-up; its sibling CVE-2026-136509 covers the replies the driver did not check, and CVE-2026-136512 the conversions that did not fit. The five siblings written up alongside this page are CVE-2026-136505, CVE-2026-136506, CVE-2026-136509, 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.
| Distribution | Status | Fixed package |
|---|---|---|
| Alpine | Tracker refused our reader on 1 December 2026 | — |
| Debian | Vulnerable 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 DLA | sid psqlodbc 1:18.00.0007-2 |
| Ubuntu | Tracker returned a server error on 1 December 2026 (twice) | nothing on 1 December 2026; odbc-postgresql at 18.00.0007 or later is the version to look for |
| RHEL, Rocky, Alma, CentOS Stream | Security-data feed refused our reader on 1 December 2026 | not read; the package is postgresql-odbc |
| openSUSE/SLE | moderate, SUSE’s own score 5.9 (AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:H) against the CNA’s 7.5, Pending (bug 1292063); Affected on SLE 15 SP7, the LTSS and ESPOS lines and Leap 15.3–15.6; released for Tumbleweed | Tumbleweed psqlODBC 18.00.0007-1.1 (openSUSE-Tumbleweed-2026-12716); nothing for SLE on 1 December 2026 |
| Fedora, Arch; source builds and vendor-bundled drivers | Not consulted; upstream fixed versions apply | psqlODBC 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 two configuration questions decide the exposure: does any DSN or connection string set UseDeclareFetch=1 or FetchRefcursors=1, and does any connection run without sslmode=verify-full.
# 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. the options that open the extra cases, and whether the server is verified
grep -niE '^(UseDeclareFetch|FetchRefcursors|sslmode)\s*=' /etc/odbc.ini ~/.odbc.ini 2>/dev/null
grep -rnoiE 'UseDeclareFetch=1|FetchRefcursors=1|sslmode=[a-z-]+' /opt /srv /etc/odbc.ini 2>/dev/null | sort -u | headA 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 the exposure is widest where step 3 finds UseDeclareFetch=1 or FetchRefcursors=1, or no sslmode at all, which means the default disable and a connection that any machine on the path can answer. A verified connection to a server you run, without those two options, leaves the cases an ordinary database user can trigger, which is a reason to upgrade in the normal cycle rather than tonight.
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 checkUntil the upgrade, do what the advisory says: “Connect with sslmode=verify-full to a trusted server. Do not use UseDeclareFetch=1 with updatable cursors.” The first closes every case that needs a hostile server or a machine in the middle; the second closes the keyset case. What not to do: sslmode=require is not the same thing, because it encrypts the connection without checking who is on the other end, and a machine in the middle can still present itself as the server; and turning off UseDeclareFetch on a workload that depends on it for large result sets will change the application’s memory use, so test it rather than flip it in production.
# mitigation: verify the server on every DSN (needs the CA that signed the server certificate)
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
# and no updatable cursors with UseDeclareFetch
sed -i -E 's/^(UseDeclareFetch\s*=).*/\1 0/' /etc/odbc.ini
isql -v mydsn myuser 2>&1 | head -3 # must still connect after the changeSources
- CVE-2026-136503 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-416, CWE-415 and CWE-787
- GHSA-48v4-hjc5-hx8w — the vendor advisory (published 25 November 2026 by davecramer): patched version 18.00.0007, the two-line workaround 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 (server error on 1 December) · 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.0057 (41st percentile) for this CVE, 30 November 2026
Related reading
- 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-136509: psqlODBC trusts server replies that do not match the queries it sent (
cve-2026-136509-psqlodbc-unchecked-server-replies, 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 andsearch_pathfit 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.
