PostgreSQLDatabase / datastore

CVE-2026-6477

HIGH · 8.8 CVSS v3.1 Published 2026-05-14
Fix available
A fix is available. Upgrade to 14.23 / 15.18 or later.
See remediation →
95/100
Remediation priority · Urgent
Remotely reachable No privileges Patch available

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

A buffer overflow vulnerability in PostgreSQL libpq's large object functions (lo_export, lo_read, lo_lseek64, lo_tell64) uses PQfn with result_is_int=0 to store arbitrary-length server-controlled data into undersized client buffers, similar to the dangerous gets() function. A malicious or compromised PostgreSQL server superuser can overwrite psql or pg_dump stack memory by sending oversized responses to connected clients.

MitigationUpdate all PostgreSQL client tools (psql, pg_dump, custom applications using libpq) to versions 18.4, 17.10, 16.14, 15.18, or 14.23 or later. Avoid connecting to untrusted or potentially compromised PostgreSQL servers until clients are patched.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
PostgreSQLDatabase / datastore
Affected:< 14.23>= 15.0, < 15.18>= 16.0, < 16.14>= 17.0, < 17.10>= 18.0, < 18.4

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check psql client version
    Run 'psql --version' or 'psql -V' to see the installed psql version
    Affected if The version is < 14.23, or >= 15.0 and < 15.18, or >= 16.0 and < 16.14, or >= 17.0 and < 17.10, or >= 18.0 and < 18.4
  2. Check libpq library version
    Run 'pg_config --lib-version' or check the shared library version in /usr/lib/ (such as libpq.so.5.x)
    Affected if The libpq library version is within any of the affected ranges listed above
  3. Check pg_dump version
    Run 'pg_dump --version' to determine the installed pg_dump version
    Affected if The version is within any of the affected ranges listed above
  4. Identify if lo_export or large object operations are used
    Search application code, scripts, or cron jobs for calls to lo_export, lo_read, lo_lseek64, lo_tell64, or PQfn with result_is_int=0
    Affected if The client uses any of these functions to interact with PostgreSQL large objects

A user is affected if they run any version of psql, pg_dump, or libpq within the affected ranges AND connect to PostgreSQL servers (potentially untrusted) that could send oversized responses during large object operations.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 14.23 / 15.18 / 16.14 or later
Fixed in 14.2315.1816.14
Vendor patch www.postgresql.org →
Interim mitigation

Update all PostgreSQL client tools (psql, pg_dump, custom applications using libpq) to versions 18.4, 17.10, 16.14, 15.18, or 14.23 or later. Avoid connecting to untrusted or potentially compromised PostgreSQL servers until clients are patched.

Recommended fix High confidence

PostgreSQL 14.23, 15.18, 16.14, or 17.10 (depending on your current major version)

  1. 1. Identify the current PostgreSQL client library (libpq) version by running: psql --version or pg_dump --version
  2. 2. Determine which major version line you are running (14, 15, 16, or 17)
  3. 3. For PostgreSQL 14.x: upgrade to version 14.23 or later
  4. 4. For PostgreSQL 15.x: upgrade to version 15.18 or later
  5. 5. For PostgreSQL 16.x: upgrade to version 16.14 or later
  6. 6. For PostgreSQL 17.x: upgrade to version 17.10 or later
  7. 7. After upgrading, restart any running psql or pg_dump processes to ensure the new library is loaded
  8. 8. Verify the fix by running: psql --version to confirm the patched version is in use
Caveat Minor releases within the same major version are generally backward compatible; however, always test in a staging environment before production deployment

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in PostgreSQL Scoped from the published advisory
  • Consultation3.0 h
  • Implementation6.0 h
  • Testing4.0 h
  • Review / QA2.0 h
15.0 hours of engineering $2,640
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,224.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-6477 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-6477 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data