Bug 2584550 (CVE-2026-136502)

Summary: CVE-2026-136502 postgresql-odbc: postgresql-odbc: Arbitrary SQL execution via statement parsing discrepancies
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: rhel-process-autobot, watson-tool-maintainers
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
A flaw was found in postgresql-odbc. Due to discrepancies in how the driver parses statement text, literals, and parameters compared to the database server, an attacker who controls input to database queries can cause unexpected SQL execution. This issue allows an attacker to run arbitrary SQL commands with the permissions of the application's database role or redirect database write operations to unauthorized tables.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description OSIDB Bzimport 2026-11-25 22:32:24 UTC
psqlODBC scans statement text itself to substitute parameters, translate ODBC escapes, join batched statements and rewrite queries for updatable cursors. Where it read the text differently from the server, text the driver took for data ran as SQL, or a positioned write went to another table:

- An escape string constant written e'…' in lower case was not recognised as one, and '…' after a keyword ending in E, as in LIKE'…', was taken for one.
- A } inside a quoted literal ended an ODBC {d …}, {t …}, {ts …} or {escape …} sequence.
- Dollar-quote tags containing _ were not recognised, and an identifier starting with _ followed by $, such as _$$, was taken for the start of a dollar quote, so a parameter marker inside a literal was substituted.
- A trailing -- comment in one statement of a batched parameter array swallowed the next statement.
- Comments, literals longer than 255 bytes and escape strings were misread when the driver located the FROM and WHERE clauses of a query for an updatable cursor, and the text copied into the cursor's own queries could include SQL from inside a literal.
- A table name containing $ was cut at the $, and a quoted table name starting with , or ; ended the table list, so positioned updates, inserts and deletes went to another table.
- An integer parameter with an embedded NUL byte cut the query short.
- /*/ was taken for a comment that opens and closes, while the server reads it as one that only opens.
- ConnSettings was split at every semicolon, including one inside a quoted literal, so an application that puts an end user's value into a SET command there ran the rest of the value as SQL at connect time.

An end user who controls text the application puts into a statement, or a parameter value, can run SQL with the rights of the application's database role. A database user who can create a table with a crafted name can redirect another user's positioned writes to a table of their choosing.

Versions up to and including psqlODBC 18.00.0006 are affected.