CVE-2026-6477: Use of Inherently Dangerous Function in PostgreSQL
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.
AI Analysis
Technical Summary
The vulnerability CVE-2026-6477 involves the use of the PQfn function in PostgreSQL's libpq client library, which does not properly limit the size of data copied into a client stack buffer. This buffer overflow occurs in functions lo_export(), lo_read(), lo_lseek64(), and lo_tell64(), enabling a PostgreSQL server superuser to overwrite client stack memory arbitrarily. Because the \lo_export command in psql and pg_dump invoke lo_read(), these client tools are susceptible to stack memory corruption. The issue affects PostgreSQL versions before 18.4, 17.10, 16.14, 15.18, and 14.23. Red Hat has published multiple security advisories and errata providing patches for affected Red Hat Enterprise Linux versions, including postgresql16-16.14-1.el10_0 and related packages.
Potential Impact
Successful exploitation allows a PostgreSQL server superuser to overwrite client stack memory in applications using libpq functions such as psql and pg_dump. This can lead to client application crashes, memory corruption, and potentially arbitrary code execution on the client side. The vulnerability has a CVSS 3.1 score of 8.8 (high severity) with network attack vector, low attack complexity, no privileges required, user interaction required, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Red Hat has released security updates for affected PostgreSQL packages (e.g., postgresql16-16.14-1.el10_0) that address this vulnerability. Users should apply these official patches promptly to remediate the issue. The vendor advisory URLs provided by Red Hat contain detailed instructions for updating affected systems. Since this is a client-side buffer overflow triggered by server responses, updating client packages is essential. Patch status is confirmed by Red Hat advisories; therefore, applying these updates is the recommended mitigation.
CVE-2026-6477: Use of Inherently Dangerous Function in PostgreSQL
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.
CVSS v3.1
Score 8.8high
Affected software
pkg:deb/postgresql/postgresqlRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability CVE-2026-6477 involves the use of the PQfn function in PostgreSQL's libpq client library, which does not properly limit the size of data copied into a client stack buffer. This buffer overflow occurs in functions lo_export(), lo_read(), lo_lseek64(), and lo_tell64(), enabling a PostgreSQL server superuser to overwrite client stack memory arbitrarily. Because the \lo_export command in psql and pg_dump invoke lo_read(), these client tools are susceptible to stack memory corruption. The issue affects PostgreSQL versions before 18.4, 17.10, 16.14, 15.18, and 14.23. Red Hat has published multiple security advisories and errata providing patches for affected Red Hat Enterprise Linux versions, including postgresql16-16.14-1.el10_0 and related packages.
Potential Impact
Successful exploitation allows a PostgreSQL server superuser to overwrite client stack memory in applications using libpq functions such as psql and pg_dump. This can lead to client application crashes, memory corruption, and potentially arbitrary code execution on the client side. The vulnerability has a CVSS 3.1 score of 8.8 (high severity) with network attack vector, low attack complexity, no privileges required, user interaction required, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Red Hat has released security updates for affected PostgreSQL packages (e.g., postgresql16-16.14-1.el10_0) that address this vulnerability. Users should apply these official patches promptly to remediate the issue. The vendor advisory URLs provided by Red Hat contain detailed instructions for updating affected systems. Since this is a client-side buffer overflow triggered by server responses, updating client packages is essential. Patch status is confirmed by Red Hat advisories; therefore, applying these updates is the recommended mitigation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- PostgreSQL
- Date Reserved
- 2026-04-17T00:44:19.965Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
- Vendor Advisory Urls
- [{"url":"https://access.redhat.com/security/cve/CVE-2026-6477","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:27718","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:27743","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:27742","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:27738","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:26181","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:29815","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:32994","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:26561","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:29953","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:26524","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:29904","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:32983","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:26525","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:29212","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:28037","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:26203","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:26204","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:27741","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:21182","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:22878","vendor":"Red Hat"}]
Threat ID: 6a05cfe8ec166c07b0e13947
Added to database: 05/14/2026, 13:36:40 UTC
Last enriched: 07/30/2026, 21:58:56 UTC
Last updated: 07/31/2026, 21:26:44 UTC
Views: 144
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.