/

CVE-2026-120065

Severity:

HIGH RISK

(7.1)

SQL Injection (CWE-89) in psqlODBC Updatable Cursors

CVE-2026-120065

Awaiting Analysis

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

SQL statement manipulation and unauthorized row modification or deletion

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

psqlODBC can build SQL statements with an auto-increment column name without escaping embedded double quotes. If an attacker can influence that column name in a table read through an updatable cursor, the altered statements may change which rows the application updates or deletes.

Affected context

The issue occurs when psqlODBC uses an updatable cursor on a table without OIDs that has an auto-increment int4 column. The server-reported column name is inserted into generated keyset queries and positioned SELECT, UPDATE, and DELETE statements. A name containing a double quote can alter the resulting SQL because the quote is not escaped.

Exploit preconditions

  • Attack surface: Database metadata used to construct driver-generated SQL for an updatable cursor
  • Required access: Ability to create a table that the application reads with an updatable cursor, or a database server that is not trusted under the active SSL settings
  • Trigger point: The driver runs keyset queries or a positioned SELECT, UPDATE, or DELETE for a qualifying table
  • Why exploitation is possible: The column name is quoted but embedded double quotes are not doubled before it is included in SQL

Why this happens

The driver places a server-reported identifier inside a quoted SQL identifier without escaping embedded double quotes. This can break out of the intended identifier boundary and change the meaning of the generated statement. This is CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Potential impact

  • An attacker could alter the conditions of driver-generated SQL statements.
  • Positioned UPDATE or DELETE operations may affect rows beyond those intended by the application.
  • Data integrity could be compromised using the application's database privileges.

General mitigation guidance

Defensive patterns focus on ensuring identifiers cannot change the meaning of generated SQL.

  • Escape identifier delimiters according to the database's identifier-quoting rules, or use safe identifier-quoting APIs.
  • Prefer parameterized statements for values and keep identifier handling separate, since ordinary value parameters do not generally substitute for identifiers.
  • Reduce trust in database metadata when it comes from user-controlled tables or servers outside the configured trust boundary.
  • Limit the privileges of database accounts used by applications and restrict which tables they can modify.

How teams detect issues like this

  • Use static analysis to identify SQL construction that inserts database-reported identifiers into statements without identifier-specific escaping.
  • Review cursor and query-building code for consistent handling of embedded identifier delimiters across SELECT, UPDATE, and DELETE paths.
  • Add tests that verify identifiers containing quote characters cannot alter generated statement structure.
  • Enforce code-review or CI policies requiring approved identifier-quoting APIs for dynamically constructed SQL.

Sources

SourceLink
github.comgithub.com/postgresql-interfaces/psqlodbc/security/advisories/GHSA-9cg8-r57h-h6jj

Frequently asked

questions

It concerns psqlODBC's generated SQL for updatable cursors on qualifying tables, where an auto-increment int4 column name is used in statements without escaping embedded double quotes.

An attacker needs to be able to create a table that the application reads with an updatable cursor, or influence the connection through a server not trusted under the current SSL settings.

Apply database-specific identifier escaping or a trusted identifier-quoting API whenever metadata is incorporated into SQL. Value parameterization alone does not address dynamic identifiers.

Treat database metadata as untrusted when appropriate, test identifier handling with delimiter characters, and review dynamic SQL construction for consistent identifier quoting and least-privilege database access.

Find out what's already
exploitable in your codebase.