---
id: "CVE-2026-120061"
kind: "vulnerability"
aliases: ["CVE-2026-120061"]
title: "psqlODBC: crafted ODBC escape sequences corrupt memory in client applications"
severity: "high"
cvss: 7.5
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["odbc", "package", "postgresql", "psqlodbc"]
not_affected_if: ["fixed-version", "trusted-sql-only"]
published_at: "2026-11-02T19:18:03+00:00"
first_seen_at: "2026-11-02T19:24:39+00:00"
updated_at: "2026-11-02T19:26:40+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-120061", "first_seen_at": "2026-11-02T19:24:39+00:00"}]
---

# psqlODBC: crafted ODBC escape sequences corrupt memory in client applications

The psqlODBC driver's parser for ODBC escape sequences writes past fixed-size stack buffers when it reads application SQL text, including {fn}, {d}, {t}, {ts} and {escape} forms. An attacker who controls SQL text sent to the driver can corrupt the process stack and copy arbitrary bytes into the query.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Find the psqlODBC driver version on the host, for example with `odbcinst -j` and the driver library path it lists.
- Check whether any application forwards untrusted or user-supplied SQL text to the driver.

## Fix

- psqlODBC: move to `18.00.0006` or later (versions before `18.00.0006` are affected).

## Timeline

- 2026-11-02T19:24:39+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-120061

## Documents

- [advisory] Vendor advisory: github.com https://github.com/postgresql-interfaces/psqlodbc/security/advisories/GHSA-hfm6-qfx8-v4xq

## From the sources

The psqlODBC parser for ODBC escape sequences in application SQL text writes the argument offsets of a {fn} escape into a fixed 16-entry stack array without a bound and does not initialize the array. An escape with too many arguments overflows the stack, and a reference to an unsupplied argument copies arbitrary bytes into the query. The copy of a {d}, {t}, {ts}, or {escape} body also writes one byte past a 128-byte stack buffer. An application that forwards untrusted SQL text to the driver exposes its process to memory corruption. Versions before psqlODBC 18.00.0006 are affected.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
