CVE-2026-138404 in psqlODBCinfo

Summary

by MITRE • 11/29/2026

With Debug or CommLog on, psqlODBC writes its log files to a shared directory under predictable names. By default that is /tmp on Unix-like systems and C:\ on Windows, and each file name holds the process ID. The logs hold SQL text, data and connection details.

On Unix-like systems, the fix for CVE-2026-120066 in 18.00.0006 made the driver refuse a symbolic link at the log path. It used an existing file only if it was a regular file owned by the user running the application. 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. The link passed every check, and the driver appended its log to the victim's file. A FIFO at the log path is a second case, which CVE-2026-120066 did not cover: opening it blocked the application until another process read from it.

On Windows, the fix for CVE-2026-120066 did not apply, and the driver opened the log file without any of these checks. A log file created in C:\ by a service or an elevated process got that directory's permissions, which let other local users read it. In a log directory created under C:\ with default permissions, they could also modify it. A file that another user had already created at the log path was used as it was. The MSDTC log in C:\ or C:\pgdtclog was opened the same way.

Debug and CommLog are off by default, and only an administrator turns them on.

Versions up to and including psqlODBC 18.00.0007 are affected.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 11/29/2026

The vulnerability in psqlODBC versions up to and including 18.00.0007 represents a critical failure in secure file handling when diagnostic logging features, specifically Debug or CommLog modes, are enabled by an administrator. These modes cause the driver to write sensitive operational data, including SQL statements, query results, and connection details, to log files located in shared system directories such as /tmp on Unix-like systems or C:\ on Windows. The core technical flaw lies in insufficient validation of file attributes before opening these paths for writing. While previous patches addressed certain symlink attacks, they failed to account for hard links, FIFOs, and cross-platform permission inheritance issues, allowing local attackers to manipulate the logging process to achieve unauthorized information disclosure or denial of service conditions.

On Unix-like systems, the driver attempts to mitigate risks by refusing symbolic links and ensuring that existing files are regular files owned by the executing user. However, this validation is incomplete because it does not verify whether a file has multiple hard links pointing to the same inode. An attacker with local access can create a hard link at the expected log path targeting a file owned by a privileged victim process or another user. Since the driver only checks ownership and regular file status without inspecting link counts, it accepts this maliciously crafted path. Consequently, when psqlODBC opens the file for appending, it writes sensitive diagnostic data directly into the attacker-controlled inode. This results in an information disclosure vulnerability where confidential SQL queries and connection parameters are leaked to any user with read access to that target file. Furthermore, if a FIFO (named pipe) is placed at the log path instead of a regular file, opening it causes the application thread to block indefinitely until another process reads from the pipe. This constitutes a denial of service condition, as the blocking operation can stall database connections and consume system resources without providing any useful output.

The situation on Windows environments presents an even more severe risk profile due to different permission models and directory inheritance behaviors. The security fixes applied in earlier versions did not extend to Windows platforms, leaving the driver open to multiple attack vectors. When psqlODBC creates a log file directly within C:\ or similar system directories without specifying explicit permissions, the new file inherits the default ACLs of that directory. For many users and services, this often results in broad read access for other local accounts. An attacker can simply create a dummy file at the expected log path before psqlODBC runs. Because the driver does not check if an existing file is present or validate its ownership, it opens this pre-existing file for appending. This allows the attacker to inject data into files owned by services running with elevated privileges, potentially leading to information leakage of sensitive connection strings and query plans from high-privilege contexts. Additionally, in directories like C:\pgdtclog used by MSDTC or other system components, similar logic applies where default permissions may allow unauthorized modification or reading of logs containing sensitive transaction data.

The operational impact of these vulnerabilities is significant for organizations relying on psqlODBC for database connectivity with diagnostic logging enabled. The primary consequence is the exposure of highly sensitive information, including plaintext SQL commands that may contain business logic secrets, personally identifiable information within query parameters, and authentication credentials embedded in connection strings. This data leakage can facilitate further attacks such as SQL injection reconnaissance or credential harvesting if logs are accessed by malicious insiders or compromised accounts. In Unix environments, the denial of service vector via FIFOs disrupts application availability, potentially causing timeouts and cascading failures in dependent services. The lack of platform parity in security patches means that Windows deployments remain particularly vulnerable to file system manipulation attacks that exploit predictable logging paths and inherited permissions.

Mitigation strategies must focus on both configuration management and technical controls. Administrators should strictly limit the use of Debug and CommLog modes, enabling them only during active troubleshooting sessions and disabling them immediately afterward to minimize the attack surface. When these features are necessary, logs should be directed to a dedicated directory with restrictive permissions that prevent other local users from reading or writing files within it. On Unix systems, administrators must ensure that log directories have strict ownership and permission settings, ideally using sticky bits on shared directories like /tmp if logging there is unavoidable, though moving logs to private application-specific directories is preferred. For Windows environments, explicit ACLs should be applied to any directory used for ODBC logging to restrict access to only the service account running psqlODBC. Upgrading to a patched version of psqlODBC that addresses these hard link and FIFO checks on Unix as well as file validation gaps on Windows is essential for long-term remediation.

From a classification perspective, this vulnerability aligns with CWE-59 Improper Link Resolution Before File Access, specifically regarding the failure to validate hard links and named pipes. The information disclosure aspect corresponds to CWE-200 Exposure of Sensitive Information to an Unauthorized Actor, while the denial of service potential maps to CWE-400 Uncontrolled Resource Consumption. In terms of adversary tactics, this vulnerability can be exploited in conjunction with ATT&CK technique T1567 Exploit Remote Service, where a local attacker leverages misconfigured file permissions or predictable paths to escalate privileges or exfiltrate data from remote services interacting via ODBC. The reliance on shared directories for logging is also indicative of CWE-379 Creation of File in Temporary Directory That Is Not Securely Created, although the specific failure here is more nuanced due to the incomplete validation logic rather than simple race conditions during creation.

Responsible

PostgreSQL

Reservation

11/29/2026

Disclosure

11/29/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!