CVE-2026-138404: psqlODBC appends its debug log to another user’s file through a hard link in /tmp

ByLinuxtastic

December 1, 2026 #CVE, #psqlODBC

psqlODBC, the PostgreSQL ODBC driver, has two logging switches, Debug and CommLog, both off by default, which write everything the driver does, including SQL text, returned data and connection details, to a log file. On Unix-like systems that file lives in /tmp under a predictable name that includes the process id. The 18.00.0006 fix for CVE-2026-120066 made the driver refuse a symbolic link at the log path and use an existing file only if it was a regular file owned by the user running the application, but “it did not check whether the file had other hard links”, so “another local user could create a hard link at the log path to a file the victim owns” and the driver “appended its log to the victim’s file”. A FIFO at the log path, which the earlier fix did not consider either, blocked the application until something read from it. Update to psqlODBC 18.00.0008; until then keep Debug and CommLog off on multi-user hosts, or point the log at a directory only the application’s user can write.

CVE-2026-138404 at a glance.

ComponentpsqlODBC, the PostgreSQL ODBC driver (psqlodbcw.so / psqlodbca.so): the log-file opening path used by the Debug and CommLog options, and on Windows the MSDTC log as well
Affected versionsevery psqlODBC release through 18.00.0007, per the PostgreSQL CNA record and the project advisory; the Unix hard-link and FIFO cases exist from 18.00.0006 onward, since earlier releases followed symbolic links outright (CVE-2026-120066). The Windows builds had no check at all
Fixed inpsqlODBC 18.00.0008, per the advisory’s patched-versions field and the project changelog, whose 18.00.0008 section says “All releases before 18.00.0008 are affected”. Debian carries 18.00.0007-2 in sid and older builds in every release, all marked vulnerable and unfixed; Ubuntu lists the package as needing evaluation; Red Hat’s page refused automated readers and SUSE’s was empty
SeverityPostgreSQL (CNA) and GitHub CVSS 3.1 6.3 Medium (AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L: a local user, a victim who turns logging on, a race to place the link), CWE-59 (improper link resolution), CWE-379 (temporary file in a directory with insecure permissions) and CWE-732 (incorrect permission assignment); the advisory’s own label is Moderate. Ubuntu Medium; Debian no urgency set; NVD Received with the CNA score only
Exploited in the wildNot on CISA’s Known Exploited Vulnerabilities list as of 1 December 2026 (catalogue 2026.11.30). EPSS 0.00183 (4.6th percentile) on 30 November 2026
Who is exposedMulti-user Linux hosts where an ODBC application runs with Debug=1 or CommLog=1 in its DSN or connection string, which an administrator has to set and which the advisory says is off by default. The attacker is another local account on the same host; what they get is the driver writing its log, with queries, results and connection parameters in it, to a file the victim owns and the attacker chose, which is an integrity attack on that file and a disclosure if the attacker can later read it, or an application that hangs on a FIFO. Single-user hosts, containers with one process, and hosts where logging is off have nothing in the path
PublishedProject advisory GHSA-g696-gg8r-7j45 and CVE record 29 November 2026; this page built 1 December 2026, last updated 1 December 2026

What it is

A world-writable shared directory with predictable file names is the classic shape of a local link attack: the attacker creates something at the path first, and the victim’s program opens it believing it made it. The 18.00.0006 fix handled the obvious form, a symbolic link to a file the attacker wants written, by refusing symbolic links and by checking that an existing file was a regular file owned by the right user. A hard link passes both checks, because a hard link is not a link in the sense lstat() reports; it is a second name for the same inode, and the inode’s owner is the victim, since the attacker linked to a file the victim already owned. Linux’s fs.protected_hardlinks sysctl (3.6 and later, enabled by most distributions) stops a user hard-linking to a file they cannot write, but a file the victim owns and the attacker can write (a shared log, a group-writable file) is exactly what it permits.

The FIFO case is simpler: a named pipe at the log path is not a symbolic link, and the earlier fix’s checks did not consider it. Opening a FIFO for writing blocks until a reader appears, so the application hangs at the point it tries to log, which is the availability-low in the vector. The advisory also describes the Windows side, where the earlier fix did not apply at all and a log created in C:\ by an elevated process inherited permissions other users could read; that part is outside this page.

18.00.0008 closes both cases; the advisory describes the problem rather than the diff, and the changelog entry is marked “(incomplete fix for CVE-2026-120066)”, the second such entry after CVE-2026-136513 in 18.00.0007. The advisory names no commit and no credit. The release date of 18.00.0008 is not on the changelog page as read for this page; the advisory and the Debian tracker date the disclosure to 29 and 30 November.

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 has a fixed package yet.

DistributionStatusFixed package
AlpineNot consulted for this page; the Alpine tracker has refused automated readers on every earlier run—
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); source “(unfixed)”. bookworm and trixie are also still open for CVE-2026-120066, the symbolic-link originalnothing on 1 December 2026
UbuntuPriority Medium; psqlodbc “Needs evaluation” on every release; no fixed version—
RHEL, Rocky, Alma, CentOS StreamTracker unreachable on 1 December 2026 (client error on the hydra JSON); nothing inferred. RHEL ships postgresql-odbc from an older line—
openSUSE/SLEPage returned empty on 1 December 2026; nothing inferred—
odbc.postgresql.org source and the PostgreSQL yum/apt repositoriesThe upstream release applies18.00.0008

How to check

Three questions: which driver build is installed; is logging on anywhere, in odbc.ini, odbcinst.ini or an application’s connection string; and is the host multi-user with a shared /tmp. The second question is the one that decides it, because a driver that never opens a log never opens a link.

# 1. which psqlODBC is installed (18.00.0008 is fixed)
dpkg -l odbc-postgresql 2>/dev/null | awk '/^ii/ {print $2, $3}'; rpm -q postgresql-odbc 2>/dev/null
strings $(ls /usr/lib/*/odbc/psqlodbcw.so /usr/lib64/psqlodbcw.so 2>/dev/null | head -1) | grep -E '^[0-9]{2}\.[0-9]{2}\.[0-9]{4}' | head -1

# 2. is Debug or CommLog switched on anywhere? (both off by default)
grep -nEi '^\s*(Debug|CommLog)\s*=\s*1' /etc/odbc.ini /etc/odbcinst.ini ~/.odbc.ini 2>/dev/null
grep -rnEi '(Debug|CommLog)=1' --include='*.ini' --include='*.conf' --include='*.properties' --include='*.env' /etc /opt /srv 2>/dev/null | head
ls -l /tmp/mylog_* /tmp/psqlodbc_* 2>/dev/null          # the driver's log names

# 3. anything already placed at those paths that is not a plain file, or has a second name?
find /tmp -maxdepth 1 \( -name 'mylog_*' -o -name 'psqlodbc_*' \) \( -type p -o -links +1 -o -type l \) -ls 2>/dev/null
sysctl fs.protected_hardlinks fs.protected_fifos

A driver at 18.00.0008 is fixed. Below that with nothing in step 2, no log is ever opened and there is nothing to exploit; this is the common case, since both switches exist for debugging. Logging on, on a host with other local accounts, is the exposed case, and a hit in step 3 means someone has already prepared the path. fs.protected_fifos=2 (Linux 4.19 and later) makes the kernel refuse to open a FIFO in a sticky world-writable directory unless the opener owns it, which closes the FIFO half on its own.

How to fix it

Update to 18.00.0008 from the PostgreSQL repositories or source; no distribution has the fix yet. The driver is a shared object loaded by each application, so restart the ODBC applications after the update.

# PostgreSQL apt repository (Debian / Ubuntu): the psqlodbc package follows upstream
sudo apt update && sudo apt install --only-upgrade odbc-postgresql
# PostgreSQL yum repository (RHEL family)
sudo dnf update postgresql-odbc
# from source: https://odbc.postgresql.org/ (18.00.0008), then restart the applications that load the driver
grep -l 'psqlodbc.*(deleted)' /proc/[0-9]*/maps 2>/dev/null | cut -d/ -f3 | sort -un | xargs -r ps -o pid,comm -p

The mitigation is to not write the log into a shared directory. Turn the switches off on a multi-user host, and where a log is needed, give the driver a private directory, which is what the advisory’s precondition assumes is absent:

# /etc/odbc.ini — logging off (the default) ...
[mydsn]
Driver = PostgreSQL Unicode
Debug = 0
CommLog = 0
# ... or, when you need a trace, a directory only the application's user can write: the driver's LogDir setting,
# in the [PostgreSQL Unicode] block of /etc/odbcinst.ini on builds that honour it
LogDir = /var/log/myapp/odbc
install -d -m 0700 -o myapp -g myapp /var/log/myapp/odbc
# and the kernel-side guard for the FIFO case, system-wide
sysctl -w fs.protected_fifos=2 && echo 'fs.protected_fifos = 2' > /etc/sysctl.d/60-protected-fifos.conf

What not to do: do not leave Debug=1 in a production DSN after a troubleshooting session, which is the configuration this and its two predecessors all depend on; and do not expect fs.protected_hardlinks to cover the hard-link case here, because it only stops links to files the attacker cannot write, and a file the victim owns but the attacker can write (a group log, a shared scratch file) is precisely the target. The private log directory removes every variant at once.

Sources

  • CVE-2026-138404 at CVE.org — the PostgreSQL CNA record (29 November 2026): the description of the hard-link and FIFO cases, the through-18.00.0007 range, the CVSS 3.1 vector and the three CWEs
  • GHSA-g696-gg8r-7j45 — the project advisory: Moderate, 6.3, patched in 18.00.0008, the Unix and Windows mechanisms, and the note that Debug and CommLog are off by default; no credit and no workaround section
  • psqlODBC changelog — the 18.00.0008 section: “This release fixes the following vulnerabilities. All releases before 18.00.0008 are affected”, listing this CVE as “(incomplete fix for CVE-2026-120066)” alongside CVE-2026-138405 and CVE-2026-138406
  • NVD entry — Received; published 29 November; the CNA’s CVSS 3.1 6.3 and the CWEs; no NVD score
  • Distribution trackers: Debian (all suites vulnerable, unfixed) and Debian’s CVE-2026-120066 entry (fixed at 18.00.0006 in forky/sid) · Ubuntu (Medium, needs evaluation) · Red Hat (unreachable on 1 December) · SUSE (empty page)
  • CISA KEV catalogue 2026.11.30, not listed · EPSS: 0.00183, 4.6th percentile, 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.