---
id: CVE-2026-120058
title: psqlODBC row cache overflow when a later FETCH changes the column count
summary: >-
  psqlODBC sizes its row cache from the column count of a cursor's first result,
  but recomputes the column count from each later FETCH reply without checking
  that it matches. A server not trusted under current SSL settings can answer a
  lat…
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H'
cvssSource: cna
cwe:
  - CWE-787
  - CWE-191
vendor: PostgreSQL
product: psqlODBC
affected:
  - psqlODBC < 18.00.0006
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: total
  timestamp: '2026-11-02T19:33:38.487446Z'
published: '2026-11-02'
updated: '2026-11-02'
sourceUpdated: '2026-11-02T19:33:49.913Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-120058'
references:
  - url: >-
      https://github.com/postgresql-interfaces/psqlodbc/security/advisories/GHSA-6rmx-9q62-4w6m
tags:
  - cve.org
epss: 0.00255
epssPercentile: 0.17225
ingestedAt: '2026-11-05T19:30:42.800Z'
---

## Overview

psqlODBC sizes its row cache from the column count of a cursor's first result, but recomputes the column count from each later FETCH reply without checking that it matches. A server not trusted under current SSL settings can answer a later FETCH with more columns and make the driver write tuple records past the end of the heap allocation. A keyset reply with fewer columns than the key fields also underflows the unsigned field count. This is reachable with UseDeclareFetch enabled. Versions before psqlODBC 18.00.0006 are affected.

## Affected

- `psqlODBC < 18.00.0006`

## Remediation

Upgrade to psqlODBC 18.00.0006 or later. The driver rejects a column count that changes between fetches of the same cursor, and a keyset reply with fewer columns than the key fields.

### Workarounds

Set UseDeclareFetch=0, or connect only to servers authenticated with sslmode=verify-full or an equivalent GSS setting.
