psqlODBC keeps several of its counts in 16-bit fields and uses several sizes without checking their range, and in every release up to and including 18.00.0006 those limits could be crossed from the application’s side, from the statement text or data an end user supplies, or from a database user who controls how large a table or value is. A row array size of 0 makes SQLSetPos() write past the bound arrays, a descriptor count above 32767 writes before the start of a heap buffer, a text value of 2 GiB or more fetched into a wide-character buffer overflows the heap, and the parser’s column cache, the rollback log of an updatable cursor and the parameter count all wrap at 16 bits. Upgrade psqlODBC to 18.00.0007 or later (18.00.0008 is current) and restart every process that has the driver loaded; the advisory offers no workaround for the wrapped counters. It is one of seventeen psqlODBC CVEs fixed in that release.
CVE-2026-136505 at a glance.
| Component | psqlODBC, the PostgreSQL ODBC driver: SQLSetPos(SQL_REFRESH) with a row array size of 0, SQL_DESC_COUNT on an APD or IPD, numeric parameters with a negative scale, SQLGetData() into wide-character buffers, the statement parser’s column-information cache, the rollback log of updatable cursors, the parameter counter, UTF-8 conversion of wide strings, SQLGetDiagField(), SQLSetDescField(SQL_DESC_NAME), SQLFetchScroll(SQL_FETCH_BOOKMARK) and the parameter conversion routines; 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:L/UI:N/S:U/C:H/I:H/A:H), the same on GHSA-4g4f-phc4-3qh7; NVD Received with the CNA’s vector; SUSE moderate and scores it 5.9 (C:N/I:L/A:H). CWE-190 (integer overflow or wraparound), CWE-787 (out-of-bounds write) and CWE-121 (stack-based buffer overflow). Crashes and heap corruption demonstrated; code execution not |
| Exploited in the wild | Not on CISA’s Known Exploited Vulnerabilities list as of 1 December 2026 (catalogue 2026.11.27). EPSS 0.0053 (38th percentile) on 30 November 2026 |
| Who is exposed | applications where someone other than the developer decides the sizes: query tools and report builders whose users type statements (a statement with 32769 or more parameter markers, or more than 32768 result columns, wraps a counter), applications whose database users can grow a table past 65535 changes in one updatable-cursor transaction or store a text value of 2 GiB or more, and applications that pass a row array size of 0, a descriptor count above 32767 or a negative numeric scale themselves. An application with fixed statements, bounded data and no updatable cursors is not on most of these paths, though the one-byte over-reads in parameter conversion need only a bound character parameter |
| Published | CVE record 25 November 2026 (PostgreSQL CNA); this page built 1 December 2026, last updated 1 December 2026 |
What it is
The record lists thirteen places and they fall into two groups. The first is values the driver should have refused: “a row array size of 0, set with SQLSetStmtAttr() or on the ARD, makes SQLSetPos() with SQL_REFRESH write past the bound arrays”; “SQL_DESC_COUNT above 32767 on an APD or IPD writes before the start of a heap buffer”; “a numeric parameter with a negative scale overflows a stack buffer”; and SQLGetData() of a text value of 2 GiB or more into a wide-character buffer “computes a wrapped size and overflows the heap”. The second group is counters kept in types too small for them: the 16-bit reference count and size of the parser’s column-information cache wrap, “which frees a cache entry still in use or overflows the cache”; an updatable cursor that records more than 65535 changes in one transaction wraps its rollback log, “which overflows it and frees it twice”; a statement with 32769 or more parameter markers “overflows a 16-bit parameter count”; and a wide-character string over 2 GiB wraps the size of its UTF-8 conversion, “which is then written below the start of a heap buffer”.
The last five are reads and writes at the edges of buffers: SQLGetDiagField() and its W variant stored the five-character SQLSTATE plus terminator before checking BufferLength, “overrunning a buffer shorter than six bytes”; the ANSI SQLSetDescField(SQL_DESC_NAME) on an IPD copied a name with strdup() and read a pointer-plus-length name past its end; SQLFetchScroll(SQL_FETCH_BOOKMARK) “did not check the bookmark it was given”; four places in parameter conversion read one byte past a bound character parameter and one of them rewrote it; and binding a date, time or timestamp C value to an integer parameter “dereferenced NULL instead of returning the conversion error”. The record is careful about where each value comes from: “from the application, from the data or statement text an end user supplies, or from a database user who controls the size of a table or value”. That spread is why the advisory’s workaround section opens with “None for the counters” and only then lists the three application-side values to avoid.
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 arithmetic entry: sizes and counts rather than parsing or protocol; its siblings CVE-2026-136512 and CVE-2026-136509 cover the buffers the server’s replies overflow. The five siblings written up alongside this page are CVE-2026-136503, 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 | medium; 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 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:L/UI:N/S:U/C:N/I:L/A:H) against the CNA’s 7.5, Pending (bug 1292064); 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 the exposure question is who writes the statements and how big the data can get: a tool that runs SQL its users type, or an updatable cursor over a table its users can grow, is on the counter paths; a fixed set of application statements over bounded data mostly is not.
# 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 exposure: user-typed statements, updatable cursors, and very large text values
grep -rnoiE 'SQLSetPos|SQLBulkOperations|SQL_CONCUR_(ROWVER|VALUES|LOCK)|SQL_CURSOR_KEYSET_DRIVEN|SQL_ATTR_ROW_ARRAY_SIZE' /opt /srv 2>/dev/null | sort -u | head
psql -Atc "select n.nspname, c.relname, a.attname from pg_attribute a join pg_class c on c.oid=a.attrelid join pg_namespace n on n.oid=c.relnamespace where a.atttypid in ('text'::regtype,'bytea'::regtype) and c.relkind='r' and n.nspname not in ('pg_catalog','information_schema');" | 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. If step 3 finds positioned updates or keyset cursors, or an application whose users type their own SQL, treat the host as exposed to the counter cases; if the application’s statements are its own and its data is bounded, the remaining cases are the application-side values the advisory names, which you control, and the one-byte over-reads, which need the upgrade.
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 checkThe advisory’s workaround section begins “None for the counters”, and that is the honest position: nothing in configuration stops a 16-bit field from wrapping. The rest of the section says the other cases can be avoided by not passing a row array size of 0, a descriptor count above 32767 or a negative numeric scale, which is advice to the application’s author rather than a setting. What not to do: do not read SUSE’s 5.9 as permission to wait on a host where users type SQL into the driver, because the vector’s PR:L is exactly that user; and do not cap SQL_ATTR_ROW_ARRAY_SIZE at 1 as a defence, since it is 0 that is dangerous, not large values.
# the only application-side relief the advisory gives: keep the three values the driver did not check in range
# row array size: never 0 SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER)n, 0) with n >= 1
# descriptor count: never above 32767; numeric scale: never negative
grep -rnE 'SQL_ATTR_ROW_ARRAY_SIZE|SQL_DESC_COUNT|SQL_DESC_SCALE' /opt/myapp /srv/myapp 2>/dev/null | headSources
- CVE-2026-136505 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-190, CWE-787 and CWE-121
- GHSA-4g4f-phc4-3qh7 — the vendor advisory (published 25 November 2026 by davecramer): patched version 18.00.0007, the “None for the counters” 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 (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.0053 (38th 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-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.
