CVE-2026-136512: psqlODBC writes a larger type into the application’s smaller buffer

ByLinuxtastic

November 30, 2026 #CVE, #psqlODBC

With SQL_C_DEFAULT, the C type of a bound column or parameter follows its SQL type, and an application sizes its buffer from the type it was told when it described the statement. In every psqlODBC release up to and including 18.00.0006, when the column turned out to have another type at fetch time, because the server reported one, the table had been altered, or an output parameter’s result column differed, the driver wrote the larger type into the smaller buffer: “12 bytes past a 4-byte buffer for a uuid”, and more in multi-row fetches, where it also stepped through the array by the larger size. Four further conversions wrote past the application’s buffer too, and a keyset arithmetic error freed a pointer that was never allocated. 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 treat SQL_C_DEFAULT bindings over tables other users can alter as suspect. It is one of seventeen psqlODBC CVEs fixed in that release.

CVE-2026-136512 at a glance.

ComponentpsqlODBC, the PostgreSQL ODBC driver: SQL_C_DEFAULT bindings of columns and output parameters, the Int8As option, int2vector columns, output parameters bound to a NULL buffer, SQLGetData() with BufferLength 0 on large-object columns, and keyset index arithmetic after SQLBulkOperations(SQL_ADD) on a static updatable cursor; 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); NVD Received with the CNA’s vector; SUSE moderate and scores it 5.9 (C:N/I:L/A:H). CWE-787 (out-of-bounds write). The GitHub advisory page GHSA-c66p-8p63-p7mr rate-limited our reader twice on 1 December 2026, so its workaround text, if any, is not reproduced here; the changelog confirms the CVE, title and score
Exploited in the wildNot on CISA’s Known Exploited Vulnerabilities list as of 1 December 2026 (catalogue 2026.11.27). EPSS 0.0042 (28th percentile) on 30 November 2026
Who is exposedapplications that bind columns with SQL_C_DEFAULT, which is what most generic ODBC consumers (reporting tools, language bindings, ETL connectors) do, against a server they do not control or over an unverified network path; and, against an honest server, applications reading tables whose owner can alter a column’s type between describe and fetch, which the record names as a second attacker: “the owner of a table the application reads”. An application that binds explicit C types and sizes its buffers itself is only on the four smaller paths
PublishedCVE record 25 November 2026 (PostgreSQL CNA); this page built 1 December 2026, last updated 1 December 2026

What it is

ODBC lets an application say “give me this column in whatever C type matches its SQL type” by binding with SQL_C_DEFAULT, and it sizes the buffer from the description it got when it prepared the statement. The driver’s job is to honour that size at fetch time even if the world has changed. psqlODBC did not: “when the column had another type at fetch time, because the server reported another type, the table was altered, or an output parameter’s result column had another type, psqlODBC wrote the larger type into the smaller buffer”. The record’s example is the worst common case, a uuid landing in a buffer sized for a 4-byte integer, “12 bytes past a 4-byte buffer”, and the multi-row variant is worse, “where the driver also steps through the array by the larger size”, so every row after the first lands further out.

The four other conversions are variations: with Int8As set to a smaller type, an int8 column fetched as SQL_C_DEFAULT “was still written as 8 bytes”; an int2vector column “returned unterminated binary data instead of text”; an output parameter the application discards by binding a NULL buffer “overflowed a stack buffer in the driver”; and SQLGetData() with BufferLength 0 on a large-object column “wrote a NUL byte past the buffer”. The last item is a keyset bug of the kind the set has several of: adding a row with SQLBulkOperations(SQL_ADD) on a static updatable cursor before the first fetch, then changing it, rolling back and fetching it, “made the keyset index arithmetic free a pointer that was never allocated and corrupt the heap”. The record names three attackers: “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), and … the owner of a table the application reads”.

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 type-mismatch entry; its sibling CVE-2026-136509 is the broader catalogue of replies the driver did not check, and CVE-2026-136505 the sizes and counters it did not bound. The five siblings written up alongside this page are CVE-2026-136503, CVE-2026-136505, CVE-2026-136506, CVE-2026-136509, 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/SLEmoderate, 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 1292070); 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 two exposure questions: is the server verified, and can anyone other than the application’s owner alter the tables it reads.

# 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 two exposure questions
grep -niE '^(sslmode|Int8As)\s*=' /etc/odbc.ini ~/.odbc.ini 2>/dev/null
# tables the application reads that it does not own (their owners can change a column's type between describe and fetch)
psql -Atc "select n.nspname, c.relname, pg_get_userbyid(c.relowner) from pg_class c join pg_namespace n on n.oid=c.relnamespace where c.relkind in ('r','v','m') and n.nspname not in ('pg_catalog','information_schema') and has_table_privilege('app_role', c.oid, 'SELECT') and pg_get_userbyid(c.relowner) <> 'app_role';"

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. An unverified connection puts the whole list in reach of the network; a verified one to your own server leaves the table-owner case, which matters wherever the application reads tables it does not own, and the four smaller conversions, which need only the right binding.

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 one measure that holds across the set is sslmode=verify-full to a trusted server, which removes the network attacker; the table-owner case has no configuration answer short of not reading tables other roles own, and binding explicit C types instead of SQL_C_DEFAULT is an application change. We could not read the advisory’s own workaround section, so the above is what the record and the siblings support. What not to do: do not set Int8As to a smaller type as a space saving on an affected driver, because the record says the driver still writes 8 bytes; and do not treat SUSE’s 5.9 as a reason to leave an unverified DSN in place, since C:N in that vector assumes the overflow is a crash and not a read of whatever landed past the buffer.

# mitigation: verify the server on every DSN; and if you can, bind explicit C types sized by the application
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
grep -rnE 'SQL_C_DEFAULT' /opt/myapp /srv/myapp 2>/dev/null | head      # each hit is a binding whose buffer the driver sizes, not you

Sources

  • CVE-2026-136512 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
  • GHSA-c66p-8p63-p7mr — the vendor advisory (published 25 November 2026 by davecramer): rate-limited our reader twice on 1 December 2026, so its workaround and credit text are not reproduced; the changelog lists it with the same title and score; 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.0042 (28th 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.