CVE-2026-136506: psqlODBC runs SQL hidden in object names it copies into its own queries

ByLinuxtastic

November 30, 2026 #CVE, #psqlODBC

psqlODBC builds queries of its own, for catalogue functions, for re-reading the rows of an updatable cursor, for positioned inserts and updates, and for procedure calls, and in every release up to and including 18.00.0006 it put names into those queries without quoting or qualifying them: the database name, the current schema, the table name in currtid2(), the column names in the SET list of SQLSetPos() and SQLBulkOperations(), cursor names, parameter names, and the = operator in an OID comparison that the server resolves through search_path. A database user who can create an object with a crafted name, or an end user who supplies a cursor or parameter name to the application, “can run SQL with the rights of the application’s database role”. Upgrade psqlODBC to 18.00.0007 or later (18.00.0008 is current) and restart every process that has the driver loaded; until then do not pass untrusted cursor or parameter names to the driver, and do not let untrusted users create objects in schemas on the application’s search_path. It is one of seventeen psqlODBC CVEs fixed in that release.

CVE-2026-136506 at a glance.

ComponentpsqlODBC, the PostgreSQL ODBC driver: the queries it composes for SQLForeignKeys(), SQLColumns() and the other catalogue functions, the currtid2() re-read of updatable-cursor rows, the INSERT and UPDATE statements behind SQLSetPos() and SQLBulkOperations(), cursor names from SQLSetCursorName() and refcursors (FetchRefcursors=1), and parameter names (SQL_DESC_NAME) in procedure calls; 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:L/UI:N/S:U/C:H/I:H/A:H), the same on GHSA-63r4-gjcj-f69v; NVD Received with the CNA’s vector; SUSE important, 7.5, agreeing with the CNA. CWE-89 (SQL injection) and CWE-706 (use of an incorrectly resolved name)
Exploited in the wildNot on CISA’s Known Exploited Vulnerabilities list as of 1 December 2026 (catalogue 2026.11.27). EPSS 0.0045 (31st percentile) on 30 November 2026
Who is exposedany application whose database users can create a database, schema, table, column or operator (the names the driver copies), and any application that lets an end user choose a cursor name or a parameter name. The SQL runs as the application’s database role, so the damage is bounded by that role’s rights: a shared-role design where every user connects as one powerful account is the worst case. Applications whose users cannot create objects and never name cursors or parameters are not on this path. The column-name case is a variant of CVE-2026-120065 and is still open on a driver patched only to 18.00.0006
PublishedCVE record 25 November 2026 (PostgreSQL CNA); this page built 1 December 2026, last updated 1 December 2026

What it is

An ODBC driver is itself a database client, and psqlODBC asks the server a good deal on the application’s behalf: catalogue functions become queries against pg_catalog, an updatable cursor re-reads rows by their identifier, and a positioned update becomes an ordinary UPDATE the driver writes out. The record lists seven places where a name went into one of those queries “without escaping or qualification”: “the database name in SQLForeignKeys(); the current schema name in catalog functions; the table name in the currtid2() call that re-reads rows of updatable cursors; column names in the inserts and updates of SQLSetPos() and SQLBulkOperations(); cursor names set with SQLSetCursorName() or returned as refcursors (FetchRefcursors=1); parameter names (SQL_DESC_NAME) in procedure calls; the = operator in an OID comparison in SQLColumns(), which the server resolves through search_path“.

Most of those names come from the catalogue, which is why the attacker here is a database user rather than a network one: whoever can create a table or column named with a quote and a semicolon gets their text pasted into the driver’s next query. The search_path case is different in kind, and is what CWE-706 is for: the driver writes = and the server picks whichever operator of that name it finds first, so a user who can create an operator in a schema that precedes pg_catalog on the application’s path supplies the function the comparison calls. The column-name entry has history: the record says it is “a variant of CVE-2026-120065 (GHSA-9cg8-r57h-h6jj)”, whose fix in 18.00.0006 doubled quotes in the stored row-identifier name used by keyset queries and the WHERE clause, but “the column names that SQLSetPos() and SQLBulkOperations() put into the SET list of their UPDATE and into the column list of their SQL_ADD INSERT come from the catalog and were not covered by it, so a driver patched to 18.00.0006 is still affected by this one”.

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 third injection in the set after CVE-2026-136500 and CVE-2026-136502, and the only one where the text comes from the catalogue rather than from the statement or the connection string. The five siblings written up alongside this page are CVE-2026-136503, CVE-2026-136505, 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.

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:L/UI:N/S:U/C:H/I:H/A:H) against the CNA’s 7.5, Pending (bug 1292065); 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 the exposure questions are on the server: which roles can create objects in the schemas the application’s role searches, and whether any object already carries a name with a quote, a semicolon or a comment marker in it.

# 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. on the server: who can create objects on the application role's search_path, and any suspicious names already there
psql -Atc "show search_path;"
psql -Atc "select nspname, pg_get_userbyid(nspowner), has_schema_privilege('public', nspname, 'CREATE') from pg_namespace where nspname not like 'pg_%' and nspname <> 'information_schema';"
psql -Atc "select 'rel', n.nspname, c.relname from pg_class c join pg_namespace n on n.oid=c.relnamespace where c.relname ~ '[;''\"-]' union all select 'col', a.attrelid::regclass::text, a.attname from pg_attribute a where a.attname ~ '[;''\"-]' and a.attnum > 0 union all select 'op', n.nspname, o.oprname from pg_operator o join pg_namespace n on n.oid=o.oprnamespace where n.nspname not in ('pg_catalog');"
# in the application: cursor or parameter names taken from input
grep -rnE 'SQLSetCursorName|SQL_DESC_NAME|FetchRefcursors' /opt/myapp /srv/myapp /etc/odbc.ini 2>/dev/null | head

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; a driver at 18.00.0006 is fixed for CVE-2026-120065 and still open for this one. Anything older is affected, and the exposure is real wherever step 3 shows a schema on the application’s search_path that untrusted roles can create in, or public still granting CREATE to everyone, which older PostgreSQL releases did by default. An operator outside pg_catalog in that output deserves a look regardless of this bug.

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 gives two rules: “Do not pass untrusted cursor or parameter names to the driver” and “Do not let untrusted users create objects in schemas on the application’s search_path“. The second is standard PostgreSQL hygiene that is worth doing anyway: revoke CREATE on public, give the application role an explicit search_path of schemas only trusted roles own, and put pg_catalog first so the = the driver writes resolves to the real operator. What not to do: do not try to sanitise names on the application side as the fix, since the driver reads them from the catalogue and the application never sees them; and do not grant the application role fewer rights as a substitute for the upgrade, because the injected SQL runs with whatever that role keeps.

# mitigation on the server: no object creation for untrusted roles on the application's path, pg_catalog first
psql -c "revoke create on schema public from public;"
psql -c "alter role app_role set search_path = pg_catalog, app_schema;"
psql -Atc "select rolname, rolconfig from pg_roles where rolname = 'app_role';"
# reconnect the application afterwards; a per-role search_path applies at session start

Sources

  • CVE-2026-136506 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-89 and CWE-706
  • GHSA-63r4-gjcj-f69v — the vendor advisory (published 25 November 2026 by davecramer): patched version 18.00.0007, the two-rule workaround, the note that it is a variant of CVE-2026-120065 (GHSA-9cg8-r57h-h6jj) left open by 18.00.0006, 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.0045 (31st 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-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 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.