# CVE-2026-6477: PostgreSQL libpq lo_* functions let server superuser overwrite client stack memory

> A malicious server superuser can overwrite client stack memory in libpq via lo_* functions, potentially enabling code execution on the client.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/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
- **Fix available:** Yes
- **Published:** 14 May 2026
- **Updated:** 25 Aug 2026
- **Also known as:** ALPINE-CVE-2026-6477, ALSA-2026:44308, ALSA-2026:44391, AZL-86840, BELL-CVE-2026-6477, BIT-postgresql-2026-6477, CLSA-2026-1785227558, DEBIAN-CVE-2026-6477, ECHO-c9b4-8303-30f9, GHSA-jm5f-gpfq-q9h3, JLSEC-2026-604, MINI-3xhf-5359-pgqj, MINI-4w43-736r-h422, MINI-6cfw-rjrh-6frq, MINI-fmj9-9qcw-3pvh, MINI-m5f4-h59r-5gcr, MINI-phrj-3qr4-636j, RHSA-2026:44308, RHSA-2026:44391, RHSA-2026:47090, RHSA-2026:49908, RHSA-2026:49909, RHSA-2026:50779, RHSA-2026:50863, RLSA-2026:44308, RLSA-2026:44391, UBUNTU-CVE-2026-6477

## What is CVE-2026-6477?

CVE-2026-6477 is a high-severity memory corruption vulnerability in Postgresql Postgresql, published on 14 May 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

Use of inherently dangerous function PQfn(..., result_is_int=0, ...) in PostgreSQL libpq lo_export(), lo_read(), lo_lseek64(), and lo_tell64() functions allows the server superuser to overwrite a client stack buffer with an arbitrarily-large response.  Like gets(), PQfn(..., result_is_int=0, ...) stores arbitrary-length, server-determined data into a buffer of unspecified size.  Because both the \lo_export command in psql and pg_dump call lo_read(), the server superuser can overwrite pg_dump or psql stack memory.  Versions before PostgreSQL 18.4, 17.10, 16.14, 15.18, and 14.23 are affected.

Weakness: CWE-120 (Buffer Copy without Checking Size of Input), CWE-242 (Use of Inherently Dangerous Function)

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

1 open source package ship an affected version, including postgresql. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `postgresql` | Bitnami | All versions | 14.23.0, 15.18.0, 16.14.0, 17.10.0, 18.4.0 |
| `libpq` | AlmaLinux:10 | All versions | 16.14-1.el10_2 |
| `libpq-devel` | AlmaLinux:10 | All versions | 16.14-1.el10_2 |
| `libpq` | AlmaLinux:9 | All versions | 13.23-3.el9_8 |
| `libpq-devel` | AlmaLinux:9 | All versions | 13.23-3.el9_8 |
| `libpq` | Red Hat:enterprise_linux:10.2 | All versions | 0:16.14-1.el10_2 |
| `libpq-debuginfo` | Red Hat:enterprise_linux:10.2 | All versions | 0:16.14-1.el10_2 |
| `libpq-debugsource` | Red Hat:enterprise_linux:10.2 | All versions | 0:16.14-1.el10_2 |
| `libpq-devel` | Red Hat:enterprise_linux:10.2 | All versions | 0:16.14-1.el10_2 |
| `libpq-devel-debuginfo` | Red Hat:enterprise_linux:10.2 | All versions | 0:16.14-1.el10_2 |
| `libpq` | Red Hat:enterprise_linux:9::appstream | All versions | 0:13.23-3.el9_8 |
| `libpq-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:13.23-3.el9_8 |
| `libpq-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:13.23-3.el9_8 |
| `libpq-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:13.23-3.el9_8 |
| `libpq-devel-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:13.23-3.el9_8 |
| `libpq` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:16.14-0.el10_0.1 |
| `libpq-debuginfo` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:16.14-0.el10_0.1 |
| `libpq-debugsource` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:16.14-0.el10_0.1 |
| `libpq-devel` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:16.14-0.el10_0.1 |
| `libpq-devel-debuginfo` | Red Hat:enterprise_linux_eus:10.0 | All versions | 0:16.14-0.el10_0.1 |
| `libpq` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:13.23-1.el8_6.1 |
| `libpq-debuginfo` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:13.23-1.el8_6.1 |
| `libpq-debugsource` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:13.23-1.el8_6.1 |
| `libpq-devel` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:13.23-1.el8_6.1 |
| `libpq-devel-debuginfo` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:13.23-1.el8_6.1 |
| `libpq` | Red Hat:rhel_e4s:9.2::appstream | All versions | 0:13.23-1.el9_2.1 |
| `libpq-debuginfo` | Red Hat:rhel_e4s:9.2::appstream | All versions | 0:13.23-1.el9_2.1 |
| `libpq-debugsource` | Red Hat:rhel_e4s:9.2::appstream | All versions | 0:13.23-1.el9_2.1 |
| `libpq-devel` | Red Hat:rhel_e4s:9.2::appstream | All versions | 0:13.23-1.el9_2.1 |
| `libpq-devel-debuginfo` | Red Hat:rhel_e4s:9.2::appstream | All versions | 0:13.23-1.el9_2.1 |
| `libpq` | Red Hat:rhel_e4s:9.4::appstream | All versions | 0:13.23-1.el9_4.1 |
| `libpq-debuginfo` | Red Hat:rhel_e4s:9.4::appstream | All versions | 0:13.23-1.el9_4.1 |
| `libpq-debugsource` | Red Hat:rhel_e4s:9.4::appstream | All versions | 0:13.23-1.el9_4.1 |
| `libpq-devel` | Red Hat:rhel_e4s:9.4::appstream | All versions | 0:13.23-1.el9_4.1 |
| `libpq-devel-debuginfo` | Red Hat:rhel_e4s:9.4::appstream | All versions | 0:13.23-1.el9_4.1 |
| `libpq` | Red Hat:rhel_eus:9.6::appstream | All versions | 0:13.23-1.el9_6.1 |
| `libpq-debuginfo` | Red Hat:rhel_eus:9.6::appstream | All versions | 0:13.23-1.el9_6.1 |
| `libpq-debugsource` | Red Hat:rhel_eus:9.6::appstream | All versions | 0:13.23-1.el9_6.1 |
| `libpq-devel` | Red Hat:rhel_eus:9.6::appstream | All versions | 0:13.23-1.el9_6.1 |
| `libpq-devel-debuginfo` | Red Hat:rhel_eus:9.6::appstream | All versions | 0:13.23-1.el9_6.1 |

Products: Postgresql Postgresql.

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

Upgrade postgresql to a fixed version for your release line: 14.23.0, 15.18.0, 16.14.0 or 17.10.0.

## Is CVE-2026-6477 being exploited?

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

## Other vulnerabilities in Postgresql Postgresql

- [CVE-2013-1902](https://insights.sbomify.com/CVE-2013-1902/): Information disclosure in n/a (critical 10.0)
- [CVE-2013-1903](https://insights.sbomify.com/CVE-2013-1903/): Information disclosure in n/a (critical 10.0)
- [CVE-2007-3279](https://insights.sbomify.com/CVE-2007-3279/): Privilege escalation in n/a (critical 10.0)
- [CVE-2002-1399](https://insights.sbomify.com/CVE-2002-1399/): Integer overflow in n/a (critical 10.0)
- [CVE-2016-3065](https://insights.sbomify.com/CVE-2016-3065/): Information disclosure in n/a (critical 9.1)

## Fix prompt for AI coding agents

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

What it is: CVE-2026-6477 is a high-severity memory corruption vulnerability in Postgresql Postgresql, published on 14 May 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-6477 in the wild and no public exploit code.

Affected packages and fixed versions:
- postgresql (Bitnami): affected all versions; fixed in 14.23.0, 15.18.0, 16.14.0, 17.10.0, 18.4.0

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-6477/ (Markdown: https://insights.sbomify.com/CVE-2026-6477/index.md)
```

## Sources

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

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