CVE-2026-6477: PostgreSQL libpq lo_* functions let server superuser overwrite client stack memory
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.
Security readout for executives and security teams
Plain-English summary
A malicious or compromised PostgreSQL server superuser can send an oversized response that overwrites memory in a connecting client. Administrative tools including psql and pg_dump are exposed through large-object operations. Successful abuse could crash or compromise the administrator’s client process, threatening confidentiality, integrity, and availability.
Executive priority
Treat this as a high-priority client-side update, especially where privileged staff or backup automation connects to externally managed or less-trusted PostgreSQL servers. The required server-superuser control and client interaction reduce universality, but compromise of administrative endpoints could have broad downstream impact.
Technical view
PostgreSQL libpq functions lo_export(), lo_read(), lo_lseek64(), and lo_tell64() use PQfn() in a mode that accepts server-determined, arbitrary-length data without a specified destination-buffer size. This enables stack-buffer overwrite in affected clients. PostgreSQL releases before 18.4, 17.10, 16.14, 15.18, and 14.23 are affected.
Likely exposure
Exposure is concentrated on systems running vulnerable libpq-based clients, particularly psql using \lo_export and pg_dump, when they connect to a server controlled by a malicious or compromised superuser. Inventory client libraries and utilities separately from database servers because the memory corruption occurs in the client process.
Exploitation context
The CVSS score is 8.8 and interaction is required: a vulnerable client must connect and invoke an affected operation. The supplied record is not in KEV, and the provided sources do not establish active exploitation.
Researcher notes
The vulnerability boundary is trust reversal: a privileged PostgreSQL server can corrupt the memory of a connecting client. Assessment should trace libpq consumers and large-object call paths, not merely exposed database ports. The bundle establishes arbitrary-length stack overwrite and high CIA impact, but does not provide evidence of public exploitation or confirm code execution.
Mitigation direction
Upgrade PostgreSQL clients and libpq to 18.4, 17.10, 16.14, 15.18, 14.23, or later supported releases.
Prioritize administrator workstations, backup hosts, automation runners, and systems executing psql or pg_dump.
Avoid affected large-object operations against untrusted or potentially compromised servers until clients are updated.
Consult PostgreSQL and operating-system vendor advisories for package-specific updates and restart requirements.
Validation and detection
Record versions of libpq, psql, and pg_dump on administrator, backup, and automation systems.
Confirm each client is at or above its branch’s fixed release.
Identify workflows using pg_dump, psql \lo_export, or applications calling the affected lo_* functions.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-120: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
5Timeline events
2ADP providers
42Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.