/

CVE-2026-120062

Severity:

HIGH RISK

(7.5)

SQL Injection (CWE-89) in psqlODBC SQLSpecialColumns

CVE-2026-120062

Awaiting Analysis

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL execution with the privileges of the database connection

Severity:

HIGH RISK

(7.5)

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's SQLSpecialColumns function inserts table and schema names into a catalog query without escaping them. If an application passes untrusted names to this function, a caller may be able to execute arbitrary SQL with the privileges of the database connection.

Affected context

The issue occurs in psqlODBC's SQLSpecialColumns catalog function when it constructs a query using table or schema names that have not been escaped. Applications are at risk when they pass names influenced by untrusted input to this function. The description identifies versions before 18.00.0006 as affected.

Exploit preconditions

  • Attack surface: An application using psqlODBC's SQLSpecialColumns function
  • Required access: Ability to influence the table or schema name supplied by the application
  • Trigger point: The function's catalog query construction and execution
  • Why exploitation is possible: The supplied names are spliced into the query without escaping, allowing them to alter its SQL structure

Why this happens

The function constructs a SQL catalog query by inserting table and schema names without appropriately escaping them. When those values are influenced by untrusted input, query syntax and data are not kept separate, which is the insecure pattern described by CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Potential impact

  • An attacker may execute arbitrary SQL using the connection's privileges.
  • Database records could be read, altered, or deleted, depending on the connection's permissions.
  • Database availability or integrity could be affected.
  • Access to connected database resources could be misused within the privileges available to the application.

General mitigation guidance

Defensive approaches focus on preventing untrusted names from changing query structure:

  • Use parameterized query mechanisms where supported, and safe identifier-quoting APIs for SQL identifiers.
  • Validate table and schema names against trusted, narrowly defined allowlists when possible.
  • Avoid passing caller-controlled names directly into catalog-query construction.
  • Apply least privilege to database connections so that a compromised query path has limited capabilities.
  • Prefer APIs and designs that minimize the need to construct SQL from dynamic identifiers.

How teams detect issues like this

  • Use static analysis to identify SQL construction that concatenates or interpolates table and schema names.
  • Review call sites of SQLSpecialColumns and trace whether supplied names can be influenced by external input.
  • Check that dynamic identifiers are validated or safely quoted, and that query values use parameterized interfaces where applicable.
  • Apply code-review policies that flag untrusted data entering SQL construction, and use database monitoring to investigate unexpected statements.

Sources

SourceLink
github.comgithub.com/postgresql-interfaces/psqlodbc/security/advisories/GHSA-gg8f-fx3w-rj33

Frequently asked

questions

It concerns psqlODBC's SQLSpecialColumns function when table or schema names are incorporated into its catalog query without escaping.

A caller must be able to influence a table or schema name passed by an application to the function. The resulting SQL runs with the privileges of the application's database connection.

Keep untrusted input from changing SQL structure. Use safe identifier handling, validate names against trusted options, and parameterize values where supported.

Review dynamic SQL construction and call sites that accept externally influenced identifiers, enforce secure query-building policies, and limit database connection privileges.

Find out what's already
exploitable in your codebase.