CVEfocus › CVE database › CVE-2026-6477

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

CVSS 8.8 HighEPSS 0.7% (higher than 49% of CVEs)Published 2026-05-14Updated 2026-08-25Assigner: 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.

CWE-120CWE-242

What to do

Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

163Fixed
4Fix pending
10Will not fix
2Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04postgresql-18Fixed18.4-0ubuntu0.26.04.1UBUNTU-CVE-2026-6477
Ubuntu 25.10postgresql-17Fixed17.10-0ubuntu0.25.10.1UBUNTU-CVE-2026-6477
Ubuntu 24.04postgresql-16Fixed16.14-0ubuntu0.24.04.1UBUNTU-CVE-2026-6477
Ubuntu 22.04postgresql-14Fixed14.23-0ubuntu0.22.04.1UBUNTU-CVE-2026-6477
Ubuntu 20.04postgresql-12Fix pendingUBUNTU-CVE-2026-6477
Ubuntu 18.04postgresql-10Fix pendingUBUNTU-CVE-2026-6477
Ubuntu 16.04postgresql-9.5Fix pendingUBUNTU-CVE-2026-6477
Ubuntu 14.04postgresql-9.3Fix pendingUBUNTU-CVE-2026-6477
Debian 14postgresql-18Fixed18.4-1DEBIAN-CVE-2026-6477
Debian 13postgresql-17Fixed17.10-0+deb13u1DEBIAN-CVE-2026-6477
Debian 12postgresql-15Fixed15.18-0+deb12u1DEBIAN-CVE-2026-6477
Red Hat Enterprise Linux 10libpqFixed0:16.14-1.el10_2RHSA-2026:44391
Red Hat Enterprise Linux 10libpq-develFixed0:16.14-1.el10_2RHSA-2026:44391
Red Hat Enterprise Linux 10postgresqlFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-contribFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-docsFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-plperlFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-plpython3Fixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-pltclFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-private-develFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-private-libsFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-serverFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-server-develFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-staticFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-testFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-test-rpm-macrosFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-upgradeFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql-upgrade-develFixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql16Fixed0:16.14-1.el10_2RHSA-2026:27743
Red Hat Enterprise Linux 10postgresql18Fixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-contribFixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-docsFixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-plperlFixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-plpython3Fixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-private-develFixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-private-libsFixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-serverFixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-server-develFixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-staticFixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-testFixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-test-rpm-macrosFixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-upgradeFixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql18-upgrade-develFixed0:18.4-1.el10_2RHSA-2026:27742
Red Hat Enterprise Linux 9libpqFixed0:13.23-3.el9_8RHSA-2026:44308
Red Hat Enterprise Linux 9libpq-develFixed0:13.23-3.el9_8RHSA-2026:44308
Red Hat Enterprise Linux 9pg_repackFixed0:1.5.3-1.module+el9.8.0+23739+1c42644cRHSA-2026:28037
Red Hat Enterprise Linux 9pgauditFixed0:1.7.0-1.module+el9.8.0+24091+17775505RHSA-2026:26204
Red Hat Enterprise Linux 9pgvectorFixed0:0.6.2-2.module+el9.8.0+24090+8f0ee565RHSA-2026:26204
Red Hat Enterprise Linux 9postgisFixed0:3.5.3-5.module+el9.8.0+24090+8f0ee565RHSA-2026:26204
Red Hat Enterprise Linux 9postgis-clientFixed0:3.6.1-2.module+el9.8.0+23739+1c42644cRHSA-2026:26203
Red Hat Enterprise Linux 9postgis-docsFixed0:3.5.3-5.module+el9.8.0+24090+8f0ee565RHSA-2026:26204
Red Hat Enterprise Linux 9postgis-upgradeFixed0:3.5.3-5.module+el9.8.0+24090+8f0ee565RHSA-2026:26204
Red Hat Enterprise Linux 9postgis-utilsFixed0:3.6.1-2.module+el9.8.0+23739+1c42644cRHSA-2026:26203
Red Hat Enterprise Linux 9postgres-decoderbufsFixed0:1.9.7-1.Final.module+el9.8.0+24091+17775505RHSA-2026:26204
Red Hat Enterprise Linux 9postgresqlFixed0:15.18-1.module+el9.8.0+24358+32c5830eRHSA-2026:27741
Red Hat Enterprise Linux 9postgresql-contribFixed0:18.4-2.module+el9.8.0+24359+da7fad50RHSA-2026:27741
Red Hat Enterprise Linux 9postgresql-docsFixed0:18.4-2.module+el9.8.0+24359+da7fad50RHSA-2026:28037
Red Hat Enterprise Linux 9postgresql-plperlFixed0:18.4-2.module+el9.8.0+24359+da7fad50RHSA-2026:26203
Red Hat Enterprise Linux 9postgresql-plpython3Fixed0:13.23-3.el9_8RHSA-2026:26204
Red Hat Enterprise Linux 9postgresql-pltclFixed0:13.23-3.el9_8RHSA-2026:28037
Red Hat Enterprise Linux 9postgresql-private-develFixed0:18.4-2.module+el9.8.0+24359+da7fad50RHSA-2026:28037
Red Hat Enterprise Linux 9postgresql-private-libsFixed0:18.4-2.module+el9.8.0+24359+da7fad50RHSA-2026:27741
Red Hat Enterprise Linux 9postgresql-serverFixed0:18.4-2.module+el9.8.0+24359+da7fad50RHSA-2026:28037
Red Hat Enterprise Linux 9postgresql-server-develFixed0:15.18-1.module+el9.8.0+24358+32c5830eRHSA-2026:27741
Red Hat Enterprise Linux 9postgresql-staticFixed0:18.4-2.module+el9.8.0+24359+da7fad50RHSA-2026:27741
Red Hat Enterprise Linux 9postgresql-testFixed0:13.23-3.el9_8RHSA-2026:28037
Red Hat Enterprise Linux 9postgresql-test-rpm-macrosFixed0:15.18-1.module+el9.8.0+24358+32c5830eRHSA-2026:26203
Red Hat Enterprise Linux 9postgresql-upgradeFixed0:16.14-1.module+el9.8.0+24360+ff98e86aRHSA-2026:27741
Red Hat Enterprise Linux 9postgresql-upgrade-develFixed0:13.23-3.el9_8RHSA-2026:26204
Red Hat Enterprise Linux 8libpqFixed0:13.23-2.el8_10RHSA-2026:27738
Red Hat Enterprise Linux 8libpq-develFixed0:13.23-2.el8_10RHSA-2026:27738
Red Hat Enterprise Linux 8pg_repackFixed0:1.4.6-3.module+el8.9.0+19330+c97ddbdfRHSA-2026:28143
Red Hat Enterprise Linux 8pgauditFixed0:16.0-1.module+el8.10.0+20413+d8116364RHSA-2026:28208
Red Hat Enterprise Linux 8postgres-decoderbufsFixed0:0.10.0-2.module+el8.9.0+19330+c97ddbdfRHSA-2026:28208
Red Hat Enterprise Linux 8postgresqlFixed0:16.14-1.module+el8.10.0+24339+d919fb58RHSA-2026:28208
Red Hat Enterprise Linux 8postgresql-contribFixed0:16.14-1.module+el8.10.0+24339+d919fb58RHSA-2026:28208
Red Hat Enterprise Linux 8postgresql-docsFixed0:15.18-1.module+el8.10.0+24361+29e043a0RHSA-2026:28208
Red Hat Enterprise Linux 8postgresql-jdbcNot affected
Red Hat Enterprise Linux 8postgresql-jdbc-javadocNot affected
Red Hat Enterprise Linux 8postgresql-plperlFixed0:13.23-3.module+el8.10.0+24363+8e5fd2e3RHSA-2026:26181
Red Hat Enterprise Linux 8postgresql-plpython3Fixed0:16.14-1.module+el8.10.0+24339+d919fb58RHSA-2026:28999
Red Hat Enterprise Linux 8postgresql-pltclFixed0:13.23-3.module+el8.10.0+24363+8e5fd2e3RHSA-2026:26181
Red Hat Enterprise Linux 8postgresql-private-develFixed0:16.14-1.module+el8.10.0+24339+d919fb58RHSA-2026:26181
Red Hat Enterprise Linux 8postgresql-private-libsFixed0:16.14-1.module+el8.10.0+24339+d919fb58RHSA-2026:26181
Red Hat Enterprise Linux 8postgresql-serverFixed0:16.14-1.module+el8.10.0+24339+d919fb58RHSA-2026:26181
Red Hat Enterprise Linux 8postgresql-server-develFixed0:13.23-3.module+el8.10.0+24363+8e5fd2e3RHSA-2026:28999
Red Hat Enterprise Linux 8postgresql-staticFixed0:16.14-1.module+el8.10.0+24339+d919fb58RHSA-2026:28999
Red Hat Enterprise Linux 8postgresql-testFixed0:16.14-1.module+el8.10.0+24339+d919fb58RHSA-2026:28208
Red Hat Enterprise Linux 8postgresql-test-rpm-macrosFixed0:12.22-7.module+el8.10.0+24362+fcf88eedRHSA-2026:26181
Red Hat Enterprise Linux 8postgresql-upgradeFixed0:12.22-7.module+el8.10.0+24362+fcf88eedRHSA-2026:28208
Red Hat Enterprise Linux 8postgresql-upgrade-develFixed0:16.14-1.module+el8.10.0+24339+d919fb58RHSA-2026:28999
Red Hat Enterprise Linux 6postgresqlWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-contribWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-develWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-docsWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-libsWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-plperlWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-plpythonWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-pltclWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-serverWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-testWill not fix
Out of support scope
AlmaLinux 10libpqFixed16.14-1.el10_2ALSA-2026:44391
AlmaLinux 10libpq-develFixed16.14-1.el10_2ALSA-2026:44391
AlmaLinux 10postgresql-test-rpm-macrosFixed16.14-1.el10_2ALSA-2026:27743
AlmaLinux 10postgresql18-test-rpm-macrosFixed18.4-1.el10_2ALSA-2026:27742
AlmaLinux 9libpqFixed13.23-3.el9_8ALSA-2026:44308
AlmaLinux 9libpq-develFixed13.23-3.el9_8ALSA-2026:44308
AlmaLinux 9pg_repackFixed1.4.8-2.module_el9.5.0+119+18833d03ALSA-2026:26204
AlmaLinux 9pgauditFixed1.7.0-1.module_el9.3.0+52+21733919ALSA-2026:26204
AlmaLinux 9pgvectorFixed0.8.1-1.module_el9.8.0+234+5456f35dALSA-2026:26203
AlmaLinux 9postgisFixed3.5.3-5.module_el9.8.0+236+2d3cbd4cALSA-2026:26204
AlmaLinux 9postgis-clientFixed3.6.1-2.module_el9.8.0+239+6fb51d38ALSA-2026:26203
AlmaLinux 9postgis-docsFixed3.5.3-5.module_el9.8.0+236+2d3cbd4cALSA-2026:26204
AlmaLinux 9postgis-upgradeFixed3.6.1-2.module_el9.8.0+239+6fb51d38ALSA-2026:26203
AlmaLinux 9postgis-utilsFixed3.5.3-5.module_el9.8.0+236+2d3cbd4cALSA-2026:26204
AlmaLinux 9postgres-decoderbufsFixed2.4.0-1.Final.module_el9.4.0+66+eb9878bcALSA-2026:26204
AlmaLinux 9postgresqlFixed15.18-1.module_el9.8.0+267+7c71b4a4ALSA-2026:26203
AlmaLinux 9postgresql-contribFixed15.18-1.module_el9.8.0+267+7c71b4a4ALSA-2026:26203
AlmaLinux 9postgresql-docsFixed13.23-3.el9_8ALSA-2026:26204
AlmaLinux 9postgresql-plperlFixed18.4-2.module_el9.8.0+280+5ad12178ALSA-2026:26203
AlmaLinux 9postgresql-plpython3Fixed16.14-1.module_el9.8.0+266+1e661e97ALSA-2026:28037
AlmaLinux 9postgresql-pltclFixed18.4-2.module_el9.8.0+280+5ad12178ALSA-2026:28037
AlmaLinux 9postgresql-private-develFixed15.18-1.module_el9.8.0+267+7c71b4a4ALSA-2026:26204
AlmaLinux 9postgresql-private-libsFixed15.18-1.module_el9.8.0+267+7c71b4a4ALSA-2026:26204
AlmaLinux 9postgresql-serverFixed13.23-3.el9_8ALSA-2026:26203
AlmaLinux 9postgresql-server-develFixed18.4-2.module_el9.8.0+280+5ad12178ALSA-2026:27741
AlmaLinux 9postgresql-staticFixed15.18-1.module_el9.8.0+267+7c71b4a4ALSA-2026:26203
AlmaLinux 9postgresql-testFixed16.14-1.module_el9.8.0+266+1e661e97ALSA-2026:27741
AlmaLinux 9postgresql-test-rpm-macrosFixed13.23-3.el9_8ALSA-2026:26204
AlmaLinux 9postgresql-upgradeFixed15.18-1.module_el9.8.0+267+7c71b4a4ALSA-2026:26204
AlmaLinux 9postgresql-upgrade-develFixed18.4-2.module_el9.8.0+280+5ad12178ALSA-2026:27741
AlmaLinux 8libpqFixed13.23-2.el8_10ALSA-2026:27738
AlmaLinux 8libpq-develFixed13.23-2.el8_10ALSA-2026:27738
AlmaLinux 8pg_repackFixed1.5.1-1.module_el8.10.0+3930+ecf33554ALSA-2026:26181
AlmaLinux 8pgauditFixed1.5.0-1.module_el8.6.0+2760+1746ec94ALSA-2026:28999
AlmaLinux 8postgres-decoderbufsFixed0.10.0-2.module_el8.6.0+3095+ee60d910ALSA-2026:28208
AlmaLinux 8postgresqlFixed15.18-1.module_el8.10.0+4195+4569d728ALSA-2026:28208
AlmaLinux 8postgresql-contribFixed16.14-1.module_el8.10.0+4199+bf03c564ALSA-2026:26181
AlmaLinux 8postgresql-docsFixed13.23-3.module_el8.10.0+4198+7a62a2ceALSA-2026:26181
AlmaLinux 8postgresql-plperlFixed13.23-3.module_el8.10.0+4198+7a62a2ceALSA-2026:26181
AlmaLinux 8postgresql-plpython3Fixed15.18-1.module_el8.10.0+4195+4569d728ALSA-2026:28208
AlmaLinux 8postgresql-pltclFixed13.23-3.module_el8.10.0+4198+7a62a2ceALSA-2026:26181
AlmaLinux 8postgresql-private-develFixed15.18-1.module_el8.10.0+4195+4569d728ALSA-2026:28143
AlmaLinux 8postgresql-private-libsFixed16.14-1.module_el8.10.0+4199+bf03c564ALSA-2026:26181
AlmaLinux 8postgresql-serverFixed16.14-1.module_el8.10.0+4199+bf03c564ALSA-2026:26181
AlmaLinux 8postgresql-server-develFixed16.14-1.module_el8.10.0+4199+bf03c564ALSA-2026:28208
AlmaLinux 8postgresql-staticFixed13.23-3.module_el8.10.0+4198+7a62a2ceALSA-2026:26181
AlmaLinux 8postgresql-testFixed13.23-3.module_el8.10.0+4198+7a62a2ceALSA-2026:26181
AlmaLinux 8postgresql-test-rpm-macrosFixed16.14-1.module_el8.10.0+4199+bf03c564ALSA-2026:28208
AlmaLinux 8postgresql-upgradeFixed16.14-1.module_el8.10.0+4199+bf03c564ALSA-2026:28208
AlmaLinux 8postgresql-upgrade-develFixed16.14-1.module_el8.10.0+4199+bf03c564ALSA-2026:28208
Rocky Linux 10libpqFixed0:16.14-1.el10_2RLSA-2026:44391
Rocky Linux 10postgresql16Fixed0:16.14-1.el10_2RLSA-2026:27743
Rocky Linux 10postgresql18Fixed0:18.4-1.el10_2RLSA-2026:27742
Rocky Linux 9libpqFixed0:13.23-3.el9_8RLSA-2026:44308
Rocky Linux 9pg_repackFixed0:1.4.8-2.module+el9.7.0+40011+28af63c9RLSA-2026:26203
Rocky Linux 9pgauditFixed0:1.7.0-1.module+el9.7.0+40011+28af63c9RLSA-2026:26203
Rocky Linux 9pgvectorFixed0:0.8.1-1.module+el9.8.0+40158+490b3c67RLSA-2026:26203
Rocky Linux 9postgisFixed0:3.5.3-5.module+el9.8.0+40163+45adab57RLSA-2026:26204
Rocky Linux 9postgres-decoderbufsFixed0:1.9.7-1.Final.module+el9.7.0+40011+28af63c9RLSA-2026:26203
Rocky Linux 9postgresqlFixed0:13.23-3.el9_8RLSA-2026:27741
Rocky Linux 8libpqFixed0:13.23-2.el8_10RLSA-2026:27738
Rocky Linux 8pg_repackFixed0:1.4.8-1.module+el8.10.0+1858+fcc46a79RLSA-2026:26181
Rocky Linux 8pgauditFixed0:1.7.0-1.module+el8.10.0+40056+df351139RLSA-2026:26181
Rocky Linux 8postgres-decoderbufsFixed0:1.9.7-1.Final.module+el8.10.0+40056+df351139RLSA-2026:26181
Alpine Linux 3.24postgresql16Fixed16.14-r0ALPINE-CVE-2026-6477
Alpine Linux 3.24postgresql17Fixed17.10-r0ALPINE-CVE-2026-6477
Alpine Linux 3.24postgresql18Fixed18.4-r0ALPINE-CVE-2026-6477
Alpine Linux 3.23postgresql16Fixed16.14-r0ALPINE-CVE-2026-6477
Alpine Linux 3.23postgresql17Fixed17.10-r0ALPINE-CVE-2026-6477
Alpine Linux 3.23postgresql18Fixed18.4-r0ALPINE-CVE-2026-6477
Alpine Linux 3.22postgresql15Fixed15.18-r0ALPINE-CVE-2026-6477
Alpine Linux 3.22postgresql16Fixed16.14-r0ALPINE-CVE-2026-6477
Alpine Linux 3.22postgresql17Fixed17.10-r0ALPINE-CVE-2026-6477
Alpine Linux 3.21postgresql15Fixed15.18-r0ALPINE-CVE-2026-6477
Alpine Linux 3.21postgresql16Fixed16.14-r0ALPINE-CVE-2026-6477
Alpine Linux 3.21postgresql17Fixed17.10-r0ALPINE-CVE-2026-6477
Alpine Linux 3.20postgresql15Fixed15.18-r0ALPINE-CVE-2026-6477
Alpine Linux 3.20postgresql16Fixed16.14-r0ALPINE-CVE-2026-6477

What the vendor says

As published in the CVE record by PostgreSQL, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Workaround: use PQexecPrepared(), not PQfn(..., result_is_int=0, ...) or its lo_* wrappers

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.