# CVE-2026-136512: Buffer overflows when a converted value does not fit the application's buffer

> A hostile or compromised PostgreSQL server can overflow buffers in psqlODBC clients, potentially executing code; applications using psqlODBC should care.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Harmful if only installed:** No
- **Needs a specific call:** No
- **Fix available:** No
- **Published:** 25 Nov 2026
- **Updated:** 25 Nov 2026
- **Also known as:** GHSA-c66p-8p63-p7mr, UBUNTU-CVE-2026-136512

## What is CVE-2026-136512?

CVE-2026-136512 is a high-severity memory corruption vulnerability in PostgreSQL psqlODBC, published on 25 Nov 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

With SQL_C_DEFAULT, the C type of a bound column or parameter follows its SQL type. An application sizes its buffer from the type it was told when it described the statement. When the column had another type at fetch time, because the server reported another type, the table was altered, or an output parameter's result column had another type, psqlODBC wrote the larger type into the smaller buffer: 12 bytes past a 4-byte buffer for a uuid, and more in multi-row fetches, where the driver also steps through the array by the larger size.

Other conversions wrote past the application's buffer as well:

- With Int8As set to a smaller type, an int8 column fetched as SQL_C_DEFAULT was still written as 8 bytes.
- An int2vector column fetched as SQL_C_DEFAULT returned unterminated binary data instead of text.
- An output parameter that the application discards by binding a NULL buffer overflowed a stack buffer in the driver.
- SQLGetData() with BufferLength 0 on a column the driver reads as a large object wrote a NUL byte past the buffer.
- Adding a row with SQLBulkOperations(SQL_ADD) on a static updatable cursor before the first fetch, then changing that row, rolling back and fetching it, made the keyset index arithmetic free a pointer that was never allocated and corrupt the heap.

This can be triggered by a hostile or compromised server, or anyone on the network path of a connection that does not use sslmode=verify-full (the default is disable), and by the owner of a table the application reads.

Versions up to and including psqlODBC 18.00.0006 are affected.

Weakness: CWE-787 (Out-of-bounds Write)

## Which versions are affected by CVE-2026-136512?

An affected version is exposed as installed. No special setting or call is needed.


## How do I fix CVE-2026-136512?

No fix has been published for CVE-2026-136512 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-136512 being exploited?

There is no known exploitation of CVE-2026-136512 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-136512 and fix it if it is affected.

What it is: CVE-2026-136512 is a high-severity memory corruption vulnerability in PostgreSQL psqlODBC, published on 25 Nov 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-136512 in the wild and no public exploit code.
Exposure: An affected version is exposed as installed. No special setting or call is needed.

Affected product: PostgreSQL psqlODBC. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-136512/ (Markdown: https://insights.sbomify.com/CVE-2026-136512/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-136512
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-136512
- OSV: https://osv.dev/vulnerability/CVE-2026-136512

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-136512/
Summaries are generated and may contain mistakes; the official description above is the record.
