psqlODBC
CVE-2026-136505
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker controls malicious server or DB value
-
DeliveryClient issues query / SQLGetData fetch
-
ExploitOversized value wraps a 16-bit or size computation
-
ExecutionDriver writes past heap/stack buffer
-
ImpactClient process crashes or heap corrupts
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires an attacker-controlled extreme size or count reaching a specific code path, for example: a row array size of 0 set via SQLSetStmtAttr/ARD combined with SQLSetPos(SQL_REFRESH); SQL_DESC_COUNT above 32767 on an APD/IPD; a text value of 2 GiB or more fetched by SQLGetData into a wide-character buffer; a wide-character string over 2 GiB converted to UTF-8; a result set or statement with more than 32768 columns; an updatable cursor recording more than 65535 changes in one transaction; 32769 or more parameter markers; a numeric parameter with a negative scale; a SQLGetDiagField buffer shorter than six bytes; or a SQLFetchScroll(SQL_FETCH_BOOKMARK) with an out-of-range bookmark. The source of the malicious value varies by sub-case: the application itself, the statement text or data an end user supplies, or a database user who controls the size of a table or value. LIMITING FACTORS: the remote (AV:N) sub-cases depend on connecting to a malicious/compromised PostgreSQL server or on a database user able to control data sizes; the multi-gigabyte and high-count thresholds are non-default extremes (reflected in AC:H); application-driven sub-cases are effectively local/self-inflicted; and only denial of service and heap corruption are demonstrated, not code execution. |
| Impact | Signals are mixed and point to a serious-but-not-emergency driver flaw. The input CVSS of 7.5 (AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H) assigns full confidentiality and integrity impact, but the vendor description explicitly states the demonstrated results are only crashes and heap corruption and that code execution has NOT been demonstrated - so the C:H/I:H of the input vector is the theoretical upside of heap corruption rather than a proven outcome, and the clearly-confirmed impact is availability (A:H via crashes). No EPSS score, no KEV listing, and no public exploit code were provided; the references are a vendor security advisory (GHSA) and a changelog, not proof-of-concept exploit code. The vuln.today decision label is 'this_week' (not act_now/emergency), consistent with a patchable client-library bug lacking active exploitation. Note also a vector/mechanism tension: AV:N is defensible only for the sub-cases where a malicious or compromised PostgreSQL server returns oversized data (e.g. a >=2 GiB text value) or where a database user controls table/value sizes; several other listed sub-bugs are triggered by the application itself supplying extreme parameters (row array size 0, SQL_DESC_COUNT, parameter counts), which is a local/application-controlled condition rather than a remote one - verify the intended threat model with the vendor. Net: a real priority to patch for anyone running psqlODBC against untrusted servers or multi-tenant databases, but the headline 7.5/RCE framing overstates the confirmed impact, which to date is denial of service and memory corruption. |
| Exploit ScenarioDerived | An attacker who controls a PostgreSQL endpoint the client connects to (a malicious or compromised server), or a database user who can control the size of a table or returned value, returns an oversized result - for example a text value of 2 GiB or more fetched via SQLGetData into a wide-character buffer, or a result set with more than 32768 columns - causing the psqlODBC driver to compute a wrapped size and corrupt the heap. The reliably demonstrated outcome is a crash (denial of service) of the client application; heap corruption raises the theoretical possibility of further impact, but code execution has not been demonstrated. No public exploit code was identified at the time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 25, 2026
Extreme sizes and counts handled without range checks in psqlODBC's driver core let 16-bit counters and 2 GiB-scale size computations wrap, producing heap buffer overflows, out-of-bounds reads and a double free inside whatever client application loads the driver. All builds up to and including psqlODBC 18.00.0006 are affected, covering the statement-attribute, descriptor (APD/IPD/ARD), parameter-conversion, SQLGetData, SQLGetDiagField, bookmark and updatable-cursor rollback-log code paths; the assessed vector is remote but high-complexity with low privileges required (AV:N/AC:H/PR:L/UI:N), and the remote sub-cases depend on connecting to a malicious or compromised PostgreSQL server, on statement text or data supplied by an end user, or on a database user who controls the size of a table or value. Demonstrated impact is denial of service and heap corruption - code execution has not been demonstrated - and no public exploit code was identified at time of analysis, with no CISA KEV entry.
RemediationAI
The provided data lists affected versions through psqlODBC 18.00.0006 but does not state an exact patched release, so treat any build at or below 18.00.0006 as vulnerable and confirm the fixed version against the vendor advisory GHSA-4g4f-phc4-3qh7 and the release notes at https://odbc.postgresql.org/changelog/ before deployment; upgrading the driver is the primary and only complete remedy for the parser, cache, rollback-log and parameter-count overflows. Where an upgrade cannot happen immediately, scope the compensating controls to the specific triggers: restrict connections to trusted PostgreSQL servers and avoid letting untrusted or third-party servers shape result metadata, since the 32768-column, 65535-change and 2 GiB-value cases need a hostile or compromised backend (trade-off: breaks legitimate use of external or shared database infrastructure); keep SQL_DESC_COUNT on APD/IPD handles, SQL_ATTR_ROW_ARRAY_SIZE and bookmark values under application control and validated before calls, which removes the descriptor and SQL_FETCH_BOOKMARK crash paths but requires auditing every place the application sets them; always pass a diagnostic buffer of at least six bytes to SQLGetDiagField/SQLGetDiagFieldW, which is cheap but must be applied consistently, including in the W variants; cap bound character parameters and fetched wide-character values well below 2 GiB and supply names to ANSI SQLSetDescField(SQL_DESC_NAME) as null-terminated strings rather than pointer-plus-length, accepting a memory ceiling on very large values; and avoid negative-scale numeric parameters plus date/time/timestamp bindings to SQL_INTEGER or SQL_SMALLINT until the conversion paths are fixed. None of these address the underlying unchecked arithmetic, so they reduce exposure only while the driver remains unpatched.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
psqlODBC is the PostgreSQL ODBC driver, a client-side library loaded by the ODBC Driver Manager into an application process; it maintains environment, connection and statement handles plus the descriptor records ARD, APD, IPD and IRD that hold bound column and parameter metadata. The root cause class is CWE-190, integer overflow/wraparound: sizes and counts are stored in types too narrow for the values the API accepts, and are used before being range-checked. Concretely, a row array size of 0 set through SQLSetStmtAttr or on the ARD makes SQLSetPos(SQL_REFRESH) index past the bound arrays; SQL_DESC_COUNT above 32767 on an APD or IPD drives a write before the start of a heap buffer; a statement field array of 32768+ columns overflows the parser, and the parser's column-information cache uses a 16-bit reference count and size that wrap, freeing a cache entry still in use or overflowing the cache; a 32769+ parameter-marker statement overflows a 16-bit parameter count; an updatable cursor logging more than 65535 changes in one transaction wraps the 16-bit capacity of its rollback log, overflowing it and freeing it twice. Size arithmetic is the other half: a text value of 2 GiB or more fetched by SQLGetData into a wide-character buffer, and a wide-character string over 2 GiB converted to UTF-8, both compute wrapped lengths that are then written below the start of a heap buffer, and a numeric parameter with a negative scale overflows a stack buffer. Smaller defects compound the picture: SQLGetDiagField/SQLGetDiagFieldW stored the five-character SQLSTATE plus terminator and only then checked BufferLength, overrunning buffers shorter than six bytes; ANSI SQLSetDescField(SQL_DESC_NAME) on an IPD ignored BufferLength and used strdup(), reading a caller-supplied pointer-plus-length name past its end; SQLFetchScroll(SQL_FETCH_BOOKMARK) trusted the bookmark value, giving an out-of-bounds read and crash; four parameter-conversion sites read one byte past a bound character parameter (one of them rewriting it); and binding a date, time or timestamp C value to an SQL_INTEGER or SQL_SMALLINT parameter dereferenced NULL instead of returning the conversion error. Public tags label this RCE, but the description and the independent assessment confine demonstrated impact to crashes and heap corruption, with the extreme thresholds and per-case attacker control reflected in the high attack complexity.
Know when Psqlodbc gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Malicious server/DB-user data reaches the client (AV:N, PR:L) but only via multi-GiB or high-count thresholds (AC:H); crashes give A:H, while heap corruption without demonstrated code execution supports only C:L/I:L.
Primary rating from Vendor (PostgreSQL).
CVSS VectorVendor: PostgreSQL
DescriptionCVE.org
psqlODBC uses sizes and counts without checking their range, or keeps them in types too small for them:
- A row array size of 0, set with SQLSetStmtAttr() or on the ARD, makes SQLSetPos() with SQL_REFRESH write past the bound arrays.
- SQL_DESC_COUNT above 32767 on an APD or IPD writes before the start of a heap buffer.
- A numeric parameter with a negative scale overflows a stack buffer.
- SQLGetData() of a text value of 2 GiB or more into a wide-character buffer computes a wrapped size and overflows the heap.
- The 16-bit reference count and size of the statement parser's column-information cache wrap, which frees a cache entry still in use or overflows the cache, and a statement with more than 32768 columns overflows the parser's field array.
- An updatable cursor that records more than 65535 changes in one transaction wraps the 16-bit capacity of its rollback log, which overflows it and frees it twice.
- A statement with 32769 or more parameter markers overflows a 16-bit parameter count.
- A wide-character string of more than 2 GiB wraps the size of its UTF-8 conversion, which is then written below the start of a heap buffer.
- SQLGetDiagField() and SQLGetDiagFieldW() always stored the five-character SQLSTATE plus its terminator and checked BufferLength only afterwards, overrunning a buffer shorter than six bytes.
- The ANSI SQLSetDescField(SQL_DESC_NAME) on an IPD ignored BufferLength and copied the name with strdup(), reading a name passed as pointer plus length past its end.
- SQLFetchScroll(SQL_FETCH_BOOKMARK) did not check the bookmark it was given, so whoever chooses the bookmark value read out of bounds and crashed the process.
- Four places in the parameter conversion read one byte past the end of a bound character parameter, and one of them rewrote it.
- Binding a date, time or timestamp C value to an SQL_INTEGER or SQL_SMALLINT parameter dereferenced NULL instead of returning the conversion error.
Depending on the case, the values come from the application, from the data or statement text an end user supplies, or from a database user who controls the size of a table or value. The demonstrated results are crashes and heap corruption; code execution has not been demonstrated.
Versions up to and including psqlODBC 18.00.0006 are affected.
Articles & Coverage 2
Technical POC Analysis
CWE-190 (integer overflow / wraparound) is the primary class, with CWE-787 (out-of-bounds write, including before the start of a buffer) and CWE-121 (stack buffer overflow) as the resulting memory-sa…
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
The psqlODBC driver, used by client applications to connect to PostgreSQL databases, contains a high-severity heap corruption vulnerability (CVE-2026-136505) affecting all versions up to 18.00.0006. A remote attacker with low privileges could exploit this by connecting to a malicious or compromised PostgreSQL server, or by supplying crafted input through an end user or database user, leading to denial of service and potential heap corruption. While code execution has not been demonstrated, the broad deployment of psqlODBC in enterprise environments means many applications could be impacted, requiring immediate attention from security and IT leadership.
No vendor-released patch identified at time of analysis. Interim mitigations include restricting connections to trusted PostgreSQL servers only, enforcing strict input validation on client applications, limiting low-privilege database users' control over data sizes, and monitoring for abnormal driver behavior or crashes.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)CVE.org
psqlODBC through 18.00.0006 parses and rebuilds connection strings in several ways that let an attacker-influenced value
SQL injection in psqlODBC up to and including 18.00.0006 lets remote unauthenticated attackers run SQL with the applicat
SQL injection in psqlODBC through 18.00.0006 lets an attacker who controls a bound character parameter or a name passed
Heap corruption in psqlODBC through 18.00.0006 can crash an application or corrupt its memory when it processes attacker
Heap corruption and driver crashes in psqlODBC (all versions up to and including 18.00.0006) stem from the driver not ve
SQL injection in psqlODBC through crafted database, schema, table, column, operator, cursor, or parameter identifiers ca
A client-side memory-corruption flaw in the PostgreSQL ODBC driver (psqlODBC) through 18.00.0006 causes the driver to wr
Memory-safety defects across several code paths in psqlODBC, the PostgreSQL ODBC driver, allow a hostile or compromised
Out-of-bounds reads and writes in psqlODBC before 18.00.0006 arise when a host application forwards untrusted column num
SQL injection in psqlODBC before 18.00.0006 allows an attacker who can influence a table or schema name passed by a host
A stack-based buffer overflow (CWE-121) in the psqlODBC driver, the official PostgreSQL ODBC driver, lets attacker-influ
Heap out-of-bounds write in the psqlODBC driver (CWE-787) affects all versions before 18.00.0006 and is reachable only w
NVD
CVE.org
EPSS
GitHub
Exploit-DB