CVE-2026-136507: psqlODBC lets a user-supplied password end the connection string early and set other keywords

ByLinuxtastic

November 30, 2026 #CVE, #psqlODBC

An ODBC connection string is a list of KEY=value; pairs, and a value that contains a semicolon has to be wrapped in braces, so PWD={…} is how a password with punctuation travels. psqlODBC, the PostgreSQL ODBC driver, got the brace parsing wrong in every release up to and including 18.00.0006: in a GBK, Big5 or SJIS connection a trailing byte 0x7d of a multibyte character was taken for the closing }, a value ending right after an escaped }} was not reported as unterminated, and the wide-character entry points cut a connection string longer than 32767 bytes of UTF-8, which changes how everything after the cut is read. In each case a value an end user supplied ends early and the rest of it becomes further keywords, so a password can carry Server= and point the application at a database the attacker owns. Upgrade psqlODBC to 18.00.0007 or later (18.00.0008 is current) and restart every process that has the driver loaded; until then reject connection-string values that contain {, }, ; or a NUL byte before they reach the driver. It is one of seventeen psqlODBC CVEs fixed in that release.

CVE-2026-136507 at a glance.

ComponentpsqlODBC, the PostgreSQL ODBC driver: the connection-string parser and builder behind SQLDriverConnect(), SQLConnectW(), SQLDriverConnectW() and SQLBrowseConnectW(), the percent-encoder for long passwords, and (on Windows only) the MSDTC XA open string; 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): the parser refuses a braced value where a multibyte lead byte precedes }, an unterminated braced value is a parse error, the W entry points no longer narrow the length, the XA open string percent-encodes the password and the XA library drops its fixed-size buffers; 18.00.0008 is the current release. The advisory is dated 25 November 2026; the changelog prints no release date
SeverityPostgreSQL (CNA) CVSS 3.1 8.1 High (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H), the same on the GitHub advisory GHSA-7638-f7xp-wv22; NVD Received with the CNA’s vector; SUSE important but scores it 7.0 (C:L/I:L/A:H). CWE-74 (injection into a downstream component), CWE-197 (numeric truncation) and CWE-121 (stack buffer overflow, the Windows MSDTC case)
Exploited in the wildNot on CISA’s Known Exploited Vulnerabilities list as of 30 November 2026 (catalogue 2026.11.27). EPSS 0.0049 (35th percentile) on 30 November 2026
Who is exposedapplications that build a connection string from something an end user typed, which in practice means “log in to the database with your own credentials” designs (reporting tools, BI front ends, admin consoles, per-user ODBC logins) where the user’s password goes into PWD={…}. The multibyte case needs a GBK, Big5 or SJIS connection; the truncation case needs a string over 32 KB through the W entry points; the escaped-}} case needs nothing special. Applications whose connection string is a constant from configuration are not on this path. The MSDTC XA case is Windows-only
PublishedCVE record 25 November 2026 (PostgreSQL CNA); this page built 30 November 2026, last updated 30 November 2026

What it is

The advisory lists five defects. The first three are about reading a connection string. A braced value such as PWD={…} is supposed to end at the first unescaped }, and in the three legacy East Asian encodings the driver supports, GBK, Big5 and Shift_JIS, a character can end in byte 0x7d, which is } in ASCII; the parser did not know that, so a password containing such a character ended early and “its contents were parsed as further keywords”. A braced value that ended right after an escaped }} “was not reported as unterminated”, with the same result. And the wide-character entry points SQLConnectW(), SQLDriverConnectW() and SQLBrowseConnectW() stored the string’s length in a type too narrow for it, so a string whose UTF-8 form is longer than 32767 bytes was cut, “which changes how the rest of it is parsed”; that is the CWE-197 entry.

The consequence is the one the record states: “an end user who supplies a password, or another value the application puts into the connection string, can set other connection keywords, for example to connect the application to a server of their choosing.” A server the attacker controls sees every query the application then runs and answers them however it likes, which is why the CNA scores confidentiality and integrity high; SUSE’s lower 7.0 reads the same facts as a partial loss. The two remaining defects are memory errors: percent-encoding a long password “wrote one byte past a 4096-byte stack buffer”, and on Windows with MSDTC the password and user name went into the XA open string unescaped, where the XA library copied each item into a 64-byte stack buffer. The record does not confine the percent-encoding overflow to Windows; the XA path exists only there.

This is one of seventeen psqlODBC advisories published together on 25 November 2026 and fixed in 18.00.0007; the advisory credits “an automated scan with the OSS Scanner (scan psqlodbc-20261105-004)”. Its siblings CVE-2026-136500 and CVE-2026-136502 are SQL injections through the driver’s own reading of statement text; this one is injection through its reading of the connection string, and it is the only one of the three with a workaround the advisory itself states. The distributions are only beginning to catch up: Debian unstable and openSUSE Tumbleweed have 18.00.0007, and 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 30 November 2026; the link in the row is the tracker page, which will be newer than this one.

DistributionStatusFixed package
AlpineTracker unreachable on 30 November 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-1 (now 1:18.00.0007-2)
UbuntuTracker returned a server error on 30 November 2026not read; odbc-postgresql at 18.00.0007 or later is the version to look for
RHEL, Rocky, Alma, CentOS StreamSecurity-data feed unreachable on 30 November 2026not read; the package is postgresql-odbc
openSUSE/SLEimportant, SUSE’s own score 7.0 against the CNA’s 8.1, Pending (bug 1292066); Affected on SLE 15 SP7, SLES 12 SP5, the 15 SP4–SP6 LTSS lines and Leap 15.3–15.6; released for TumbleweedTumbleweed psqlODBC 18.00.0007-1.1 (openSUSE-Tumbleweed-2026-12716); nothing for SLE on 30 November 2026
Fedora, Arch; source builds and vendor-bundled driversNot consulted; upstream fixed versions applypsqlODBC 18.00.0007 or 18.00.0008

How to check

Three questions: which driver is installed, does any application build its connection string at run time from user input, and are any connections in a GBK, Big5 or SJIS encoding. The first is a file, the second is the application, the third is visible from the server.

# 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. applications that assemble a connection string from input: look for PWD= or UID= built from variables, and the W entry points
grep -rnE 'PWD=\{?["$]|UID=\{?["$]|SQLDriverConnectW?|SQLBrowseConnectW?|SQLConnectW' /opt/myapp /srv/myapp /etc/odbc.ini 2>/dev/null | head
# a DSN with a fixed PWD= in /etc/odbc.ini is a constant string: not this bug (though not good practice either)
grep -nE '^(PWD|Password|UID|Username)\s*=' /etc/odbc.ini ~/.odbc.ini 2>/dev/null

# 3. on the server: which ODBC connections are not UTF-8 (the multibyte brace case needs GBK, Big5 or SJIS)
psql -Atc "select datname, usename, client_addr, application_name from pg_stat_activity where application_name ilike '%odbc%';"
psql -Atc "select datname, datcollate, pg_encoding_to_char(encoding) from pg_database;"
psql -Atc "select rolname, rolconfig from pg_roles where rolconfig::text ilike '%client_encoding%';"

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 exposed when step 2 finds an application that puts a user’s own password or user name into the string it hands to SQLDriverConnect(): that is the whole precondition for the escaped-}} case, and with a GBK, Big5 or SJIS client_encoding from step 3 the multibyte case joins it. An application that reads its connection string from a configuration file and never lets a user change it is not on this path, whatever version of the driver it has; upgrade it anyway for the sixteen siblings.

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 30 November 2026 only Debian sid and openSUSE Tumbleweed ship the fix as a package, so on a stable release the choice 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, bug 1292066)
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 whatever has it mapped
for p in $(sudo grep -l psqlodbc /proc/[0-9]*/maps 2>/dev/null | cut -d/ -f3); do ps -o pid,comm= -p "$p"; done

Until the upgrade, use the workaround the advisory gives: “Reject connection string values that contain {, }, ; or NUL characters before passing them to the driver.” That is a one-line check in the application, before the string is assembled, and it closes the escaped-brace and multibyte cases outright; keeping user-supplied values under a few hundred bytes closes the truncation and percent-encoding cases. What not to do: wrapping the value in braces yourself is not a defence, because braces are exactly what the parser misreads; and pinning the server with a Server= keyword earlier in the string does not help, since the injected keyword comes later and the last one wins.

# mitigation in the application, before the connection string is built (shell illustration; do the same in your language)
case "$user_password" in
  *[\{\}\;]*) echo "password contains { } or ; - refusing to build a connection string from it" >&2; exit 1 ;;
esac
[ "${#user_password}" -le 256 ] || { echo "password too long" >&2; exit 1; }
# and prefer a DSN whose Server=, Port= and Database= are fixed in /etc/odbc.ini, with only UID and PWD supplied at run time

Sources

  • CVE-2026-136507 at CVE.org — the PostgreSQL CNA record (25 November 2026): the five defects, affected 0 to and including 18.00.0006, CVSS 3.1 8.1, CWE-74, CWE-197 and CWE-121
  • GHSA-7638-f7xp-wv22 — the vendor advisory (published 25 November 2026): patched version 18.00.0007, what the patch changes, the workaround and the OSS Scanner credit; psqlODBC changelog for the 18.00.0007 and 18.00.0008 entries
  • NVD entry — Received on 30 November 2026, carrying the CNA’s vector and CWEs; no NVD score or CPEs yet
  • Distribution trackers: Debian (fixed in sid 1:18.00.0007-1, no DSA) · Ubuntu (server error on 30 November) · Red Hat (unreachable on 30 November) · SUSE (important, 7.0, bug 1292066, Tumbleweed fixed) · Alpine (unreachable on 30 November)
  • CISA KEV catalogue 2026.11.27, not listed · EPSS score for this CVE, 30 November 2026

Related reading

This advisory page was assembled from the primary sources listed above on 30 November 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.