{"id":"CVE-2026-6477","year":2026,"sequence":6477,"component":"client","score":8.8,"cvss_version":"3.0","vector":"AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","first_published":"2026-05-14","source_url":"https://www.postgresql.org/support/security/CVE-2026-6477/","facts":{"affected":{"14":"14","15":"15","16":"16","17":"17","18":"18"},"affected_ranges":[{"from":"0","until":"14.23"},{"from":"15","until":"15.18"},{"from":"16","until":"16.14"},{"from":"17","until":"17.10"},{"from":"18","until":"18.4"}],"cna_url":"https://cveawg.mitre.org/api/cve/CVE-2026-6477","component":"client","cvss_version":"3.0","description_en":"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.","first_published":"2026-05-14","fixed":{"14":"14.23","15":"15.18","16":"16.14","17":"17.10","18":"18.4"},"id":"CVE-2026-6477","introduced":{},"published":{"14":"2026-05-14","15":"2026-05-14","16":"2026-05-14","17":"2026-05-14","18":"2026-05-14"},"score":8.8,"title":"PostgreSQL libpq lo_* functions let server superuser overwrite client stack memory","url":"https://www.postgresql.org/support/security/CVE-2026-6477/","vector":"AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"},"reviewed_hash":"6a65a7884245936f6adaef8709d290d460e999dfce1ad78734fa7c9a324ed325","source_hash":"965b9e2323feab543f3cbeb74c418c3a5b43cbefc6594d2862ff0d24dcf8e6a2","text":{"locale":"en","title":"PostgreSQL libpq lo_* functions let server superuser overwrite client stack memory","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.","details":null,"format":"plain","provenance":{"fetched_at":"2026-09-26T10:56:06+00:00","path":"compare/security.json","root":"source-data","sha256":"6a65a7884245936f6adaef8709d290d460e999dfce1ad78734fa7c9a324ed325","source_archive_sha256":"8d8ad63581e1d27b3a0f995ded3feb81c265e38b2ac652eb22f022f52c2240ec","source_revision":"004bc292ee31c11f9a41ab007e9d8116bce29a71","source_url":"https://www.postgresql.org/support/security/"},"text_hash":"3309e2da58d09e884e846ccd364bc03e67b35daa72c03ce08759431b0425ffe5"},"locales":["en","zh-Hans"],"fixes":[{"major":"14","fixed_version":"14.23","introduced":null,"published_date":"2026-05-14","facts":{"fixed":"14.23","introduced":null,"published":"2026-05-14"}},{"major":"15","fixed_version":"15.18","introduced":null,"published_date":"2026-05-14","facts":{"fixed":"15.18","introduced":null,"published":"2026-05-14"}},{"major":"16","fixed_version":"16.14","introduced":null,"published_date":"2026-05-14","facts":{"fixed":"16.14","introduced":null,"published":"2026-05-14"}},{"major":"17","fixed_version":"17.10","introduced":null,"published_date":"2026-05-14","facts":{"fixed":"17.10","introduced":null,"published":"2026-05-14"}},{"major":"18","fixed_version":"18.4","introduced":null,"published_date":"2026-05-14","facts":{"fixed":"18.4","introduced":null,"published":"2026-05-14"}}],"legacy":[{"source":"center","source_id":46,"observed_at":"2026-10-03 12:08:35.169032+08","raw":{"id":46,"cve":"2026-6477","public":true,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","details":"PostgreSQL libpq 的 lo_export()、lo_read()、lo_lseek64() 和 lo_tell64() 使用了本质上不安全的 PQfn(..., result_is_int=0, ...)，使服务器超级用户能够用任意长度的响应覆盖客户端栈缓冲区。 与 gets() 类似，该调用会把由服务器决定的任意长度数据写入大小未指定的缓冲区。由于 psql 的 \\lo_export 命令和 pg_dump 都会调用 lo_read()，服务器超级用户可覆盖 pg_dump 或 psql 的栈内存。 PostgreSQL 18.4、17.10、16.14、15.18 和 14.23 之前的版本受此问题影响。","component":"client","cvenumber":202606477,"description":"PostgreSQL libpq 的 lo_* 函数可让服务器超级用户覆盖客户端栈内存","detailslink":"","legacyscore":"","newspost_id":3294},"fixes":[{"source_id":167,"source_version_id":31,"major":"18","fixed_minor":4,"raw":{"id":167,"patch_id":46,"version_id":31,"fixed_minor":4},"version_raw":{"id":31,"tree":18.0,"current":true,"docsgit":"","eoldate":"2030-11-14","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T08:10:47.078613+08:00","latestminor":6,"firstreldate":"2025-09-25"}},{"source_id":168,"source_version_id":30,"major":"17","fixed_minor":10,"raw":{"id":168,"patch_id":46,"version_id":30,"fixed_minor":10},"version_raw":{"id":30,"tree":17.0,"current":false,"docsgit":"","eoldate":"2029-11-08","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T08:10:47.078613+08:00","latestminor":11,"firstreldate":"2024-09-26"}},{"source_id":169,"source_version_id":29,"major":"16","fixed_minor":14,"raw":{"id":169,"patch_id":46,"version_id":29,"fixed_minor":14},"version_raw":{"id":29,"tree":16.0,"current":false,"docsgit":"","eoldate":"2028-11-09","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T08:10:47.078613+08:00","latestminor":15,"firstreldate":"2023-09-14"}},{"source_id":170,"source_version_id":28,"major":"15","fixed_minor":18,"raw":{"id":170,"patch_id":46,"version_id":28,"fixed_minor":18},"version_raw":{"id":28,"tree":15.0,"current":false,"docsgit":"","eoldate":"2027-11-11","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T08:10:47.078613+08:00","latestminor":19,"firstreldate":"2022-10-13"}},{"source_id":171,"source_version_id":27,"major":"14","fixed_minor":23,"raw":{"id":171,"patch_id":46,"version_id":27,"fixed_minor":23},"version_raw":{"id":27,"tree":14.0,"current":false,"docsgit":"","eoldate":"2026-11-12","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T08:10:47.078613+08:00","latestminor":24,"firstreldate":"2021-09-30"}}]},{"source":"pgweb","source_id":46,"observed_at":"2026-10-03 12:08:55.967155+08","raw":{"id":46,"cve":"2026-6477","public":true,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","details":"PostgreSQL libpq 的 lo_export()、lo_read()、lo_lseek64() 和 lo_tell64() 使用了本质上不安全的 PQfn(..., result_is_int=0, ...)，使服务器超级用户能够用任意长度的响应覆盖客户端栈缓冲区。 与 gets() 类似，该调用会把由服务器决定的任意长度数据写入大小未指定的缓冲区。由于 psql 的 \\lo_export 命令和 pg_dump 都会调用 lo_read()，服务器超级用户可覆盖 pg_dump 或 psql 的栈内存。 PostgreSQL 18.4、17.10、16.14、15.18 和 14.23 之前的版本受此问题影响。","component":"client","cvenumber":202606477,"description":"PostgreSQL libpq 的 lo_* 函数可让服务器超级用户覆盖客户端栈内存","detailslink":"","legacyscore":"","newspost_id":3294},"fixes":[{"source_id":167,"source_version_id":31,"major":"18","fixed_minor":4,"raw":{"id":167,"patch_id":46,"version_id":31,"fixed_minor":4},"version_raw":{"id":31,"tree":18.0,"current":true,"docsgit":"","eoldate":"2030-11-14","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T00:10:45.258078+08:00","latestminor":6,"firstreldate":"2025-09-25"}},{"source_id":168,"source_version_id":30,"major":"17","fixed_minor":10,"raw":{"id":168,"patch_id":46,"version_id":30,"fixed_minor":10},"version_raw":{"id":30,"tree":17.0,"current":false,"docsgit":"","eoldate":"2029-11-08","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T00:10:45.258078+08:00","latestminor":11,"firstreldate":"2024-09-26"}},{"source_id":169,"source_version_id":29,"major":"16","fixed_minor":14,"raw":{"id":169,"patch_id":46,"version_id":29,"fixed_minor":14},"version_raw":{"id":29,"tree":16.0,"current":false,"docsgit":"","eoldate":"2028-11-09","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T00:10:45.258078+08:00","latestminor":15,"firstreldate":"2023-09-14"}},{"source_id":170,"source_version_id":28,"major":"15","fixed_minor":18,"raw":{"id":170,"patch_id":46,"version_id":28,"fixed_minor":18},"version_raw":{"id":28,"tree":15.0,"current":false,"docsgit":"","eoldate":"2027-11-11","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T00:10:45.258078+08:00","latestminor":19,"firstreldate":"2022-10-13"}},{"source_id":171,"source_version_id":27,"major":"14","fixed_minor":23,"raw":{"id":171,"patch_id":46,"version_id":27,"fixed_minor":23},"version_raw":{"id":27,"tree":14.0,"current":false,"docsgit":"","eoldate":"2026-11-12","reldate":"2026-08-13","testing":0,"supported":true,"docsloaded":"2026-09-27T00:10:45.258078+08:00","latestminor":24,"firstreldate":"2021-09-30"}}]}]}
