CVE-2026-138405: psqlODBC’s log masking misses other spellings of the password keyword and reveals its length

ByLinuxtastic

December 1, 2026 #CVE, #psqlODBC

psqlODBC’s debug log masks the password in a connection string before writing it, and the PostgreSQL CNA record says the mask was narrower than the parser: “It masked only a keyword written exactly as PWD or Password. A password given under ‘ PWD’, ‘PWD ‘, ‘Passwd’ or ‘sslpassword’ went into the log unmasked”, and because the per-keyword log line showed the value of any keyword the driver did not recognise, a password under a misspelt keyword was logged too. The mask itself replaced the secret one character at a time, so even a correctly masked log showed the password’s length, and the length of every secret inside pqopt. As with CVE-2026-136504, the log is off by default, an administrator turns it on, and the exposure is whoever reads the log afterwards, in practice a file attached to a bug report; the vector is local with user interaction and high confidentiality impact, 5.0. The earlier CVE’s fix in 18.00.0007 did not touch the mask, so 18.00.0007 is affected. Upgrade to psqlODBC 18.00.0008, and treat any MyLog file written by an older driver as containing the password.

CVE-2026-138405 at a glance.

ComponentpsqlODBC, the PostgreSQL ODBC driver: the password masking applied before a connection string is written to the MyLog debug log
Affected versionspsqlODBC up to and including 18.00.0007, per the PostgreSQL CNA record and NVD (“All releases before 18.00.0008 are affected” in the changelog). Debian bookworm (13.02.0000), trixie (17.00.0004), forky (18.00.0006) and sid at 1:18.00.0007-2 are all in range
Fixed inpsqlODBC 18.00.0008 (the changelog entry: “Debug log records the database password under several spellings of the keyword, and the length of masked passwords (CVE-2026-138405, GHSA-vj88-7qrf-48fg, CVSS 3.1 5.0 Medium)”). No distribution had a fixed package on 1 December 2026: Debian sid is at 1:18.00.0007-2 and marks it unfixed, SUSE lists no fixed packages. The changelog gives no release date
SeverityPostgreSQL (CNA) CVSS 3.1 5.0 Medium (AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N), CWE-532 (sensitive information in a log file); SUSE moderate; NVD Received with the CNA score. Ubuntu and Red Hat pages were unreachable on 1 December
Exploited in the wildNot on the CISA KEV catalogue (2026.11.30). EPSS 0.00217 (7th percentile) on 30 November 2026
Who is exposedHosts where an administrator turned MyLog on (the Debug DSN setting) while applications connected through psqlODBC 18.00.0007 or older with the password under any keyword other than exactly PWD or Password, which includes Passwd, sslpassword, a keyword with surrounding spaces or a typo; and, for the length leak, every connection logged by every affected version. Whoever reads or receives the log is the audience
PublishedCVE record 29 November 2026; this page built 1 December 2026, last updated 1 December 2026

What it is

The connection-string parser in psqlODBC is forgiving: it accepts the password under several keyword spellings, and keywords with stray spaces, and it tolerates keywords it does not know. The masking that runs before the string is logged was written for the two canonical spellings only. The record lists the consequences:  PWD, PWD , Passwd and sslpassword all went into the log unmasked, and because the driver logs each keyword with its value and did so for unrecognised keywords as well, a password under a misspelt keyword was logged in the clear too. An application that builds its connection string with Passwd=, or a libpq-style sslpassword= for an encrypted client key, was therefore unprotected by the mask from the start.

The second finding is subtler and applies to every logged connection: “A masked secret was replaced one character at a time, so the log showed the length of the password, and of each secret in pqopt.” A reader of the log learns how long the password is, which narrows a guess and, for a short or policy-fixed length, says a good deal. The record separates this from CVE-2026-136504, which was about two sites that logged the string before the mask ran at all (the Unicode connect functions and the Windows setup dialog’s Test button) and was fixed in 18.00.0007: “The faults described here are in the masking itself, and they remain in 18.00.0007.” That is why a host that took the November set of seventeen fixes is still in range for this one.

18.00.0008 is the fix, released alongside CVE-2026-138404 (log file hard link, an incomplete fix for CVE-2026-120066) and CVE-2026-138406 (another local user’s pgenlist.dll loaded into the application, Windows). The GHSA page for this CVE returned a client error and was not read, so no credits are given here. The record repeats the framing that bounds the risk: the debug log is off by default, only an administrator turns it on with the Debug setting, and only someone who later reads the log sees the password, “which in practice means a log attached to a bug report or sent to support”. The facts are from the CVE record, the odbc.postgresql.org changelog, NVD, EPSS and the Debian and SUSE trackers; Ubuntu’s page returned a server error and Red Hat’s hydra JSON a client error on 1 December.

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. No distribution had a fixed package on 1 December 2026; the package is psqlodbc on Debian (binary odbc-postgresql), psqlODBC on SUSE and postgresql-odbc on the RHEL family.

DistributionStatusFixed package
AlpineNot consulted on 1 December 2026; nothing inferred—
Debianpsqlodbc vulnerable in bookworm (1:13.02.0000-2), trixie (1:17.00.0004-2), forky (1:18.00.0006-1) and sid (1:18.00.0007-2); “(unfixed)”; no DSA; urgency not setnothing on 1 December 2026
UbuntuTracker unreachable on 1 December 2026 (server error); nothing inferred—
RHEL, Rocky, Alma, CentOS StreamRed Hat hydra JSON unreachable on 1 December 2026 (client error); nothing inferred—
SUSE · Fedora · ArchSUSE moderate, state Pending, CNA CVSS 5.0; Affected on every listed product, no fixed packages; bug 1292284; page created 30 November. Fedora and Arch not consultednothing on 1 December 2026
Upstream psqlODBC (odbc.postgresql.org), PGDG repositoriesThe upstream fix appliespsqlODBC 18.00.0008

How to check

Three questions, in order: which driver is installed (18.00.0007 is still in range for this one), whether MyLog is or has been on, and which keyword your applications use for the password, since PWD= and Password= were masked (length aside) and anything else was not.

# 1. driver version (only 18.00.0008 or later is fixed)
dpkg -l odbc-postgresql 2>/dev/null | awk '/^ii/ {print $2, $3}'; rpm -q postgresql-odbc psqlODBC 2>/dev/null
strings "$(odbcinst -q -d -n PostgreSQL 2>/dev/null | sed -n "s/^Driver=//p")" 2>/dev/null | grep -m1 -E "^[0-9]+\.[0-9]{2}\.[0-9]{4}"

# 2. is MyLog on anywhere, and are there log files?
grep -HniE "^\s*(Debug|CommLog)\s*=\s*(1|yes|on)" /etc/odbc.ini /etc/odbcinst.ini ~/.odbc.ini 2>/dev/null
ls -la /tmp/mylog_* /tmp/psqlodbc_* /var/tmp/mylog_* 2>/dev/null

# 3. which password keyword do your DSNs and applications use? (anything but exactly PWD / Password was logged unmasked)
grep -HniE "^\s*(passwd|sslpassword|pwd\s|\spwd|password)\s*=" /etc/odbc.ini ~/.odbc.ini 2>/dev/null
grep -rHniE "(passwd|sslpassword)=" /etc/*/ /opt/*/conf* /srv 2>/dev/null | grep -iv "^/etc/odbc" | head
# and in an existing log: an unmasked secret, or a masked one whose x-run gives the length away
grep -hoE "(PWD|Password|Passwd|sslpassword)\s*=\s*[^;[:space:]]+" /tmp/mylog_* 2>/dev/null | sort | uniq -c

A host on 18.00.0008 is done. On any older driver, a DSN or application in step 3 that uses Passwd, sslpassword, a keyword with a stray space or a misspelling has had its secret logged in the clear whenever MyLog was on; one that uses PWD or Password has had its length logged. The last grep over an existing log shows which: a value that is not a run of x is the secret, and a run of x is its length. Any such log that left the host is a reason to rotate the password.

How to fix it

Install 18.00.0008 when your distribution ships it, or from upstream now, and reconnect; applications load the driver at connect time. Then deal with the logs.

# upstream source, for a host that cannot wait for a package
curl -O https://ftp.postgresql.org/pub/odbc/releases/REL-18_00_0008/psqlodbc-18.00.0008.tar.gz
# (PGDG repositories and distributions: watch for 18.00.0008 and then)
sudo apt update && sudo apt install --only-upgrade odbc-postgresql      # Debian / Ubuntu
sudo dnf upgrade postgresql-odbc                                        # RHEL family
sudo zypper patch                                                       # SUSE

# until then: turn MyLog off where it is not needed, and shred logs written by the old driver
sudo sed -i -E "s/^(\s*Debug\s*=\s*)(1|yes|on)/\10/I" /etc/odbc.ini
sudo shred -u /tmp/mylog_* /tmp/psqlodbc_* 2>/dev/null
# and use the canonical keyword, which at least gets masked (length aside) on older drivers
sed -i -E "s/^(\s*)(Passwd|passwd)\s*=/\1PWD=/" ~/.odbc.ini

The control is the same as for the earlier CVE: MyLog is a debug tool, keep it off, and read any log before it leaves the host. Using exactly PWD= or Password= in connection strings narrows the leak to the length on an unfixed driver, which is our reading of the record rather than a vendor workaround. What not to do: do not treat 18.00.0007 as closing the log problem because it closed CVE-2026-136504, since the record says the masking faults “remain in 18.00.0007”; and do not count a log as clean because every password in it reads xxxxx, since the number of xs is the finding.

Sources

  • CVE-2026-138405 at CVE.org — the PostgreSQL CNA record (29 November 2026): the keyword spellings, the unrecognised-keyword logging, the character-by-character mask, the distinction from CVE-2026-136504, affected through 18.00.0007, CVSS 3.1 5.0, CWE-532
  • psqlODBC changelog — the 18.00.0008 section: “All releases before 18.00.0008 are affected”; this CVE with GHSA-vj88-7qrf-48fg beside CVE-2026-138404 and CVE-2026-138406; no release dates on the page
  • GHSA-vj88-7qrf-48fg — client error on 1 December 2026, not read
  • NVD entry — Received; published 29 November 2026; the CNA’s CVSS 3.1 vector; CWE-532; affected through 18.00.0007
  • Distribution trackers: Debian (every suite vulnerable, sid 1:18.00.0007-2 unfixed) · SUSE (moderate, pending, no fixed packages; bug 1292284) · Ubuntu (server error) · Red Hat (client error) on 1 December 2026
  • CISA KEV catalogue 2026.11.30, not listed · EPSS 0.00217 (percentile 0.070) on 30 November 2026

Related reading

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.