CVE-2026-2007PostgreSQL pg_trgm heap buffer overflow writes pattern onto server memory
Heap buffer overflow in PostgreSQL pg_trgm allows a database user to achieve unknown impacts via a crafted input string. The attacker has limited control over the byte patterns to be written, but we have not ruled out the viability of attacks that lead to privilege escalation. PostgreSQL 18.1 and 18.0 are affected.
What to do
Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux: see the table below for the fixed version per release.
Red Hat, Ubuntu have 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
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.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | postgresql-18 | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | postgresql-17 | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | postgresql-16 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | postgresql-14 | Not affected vulnerable_code_not_present | ||
| Ubuntu 14.04 | postgresql-9.3 | Fix pending | UBUNTU-CVE-2026-2007 | |
| Debian 14 | postgresql-18 | Fixed | 18.2-1 | DEBIAN-CVE-2026-2007 |
| Red Hat Enterprise Linux 10 | postgresql18 | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-contrib | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-docs | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-plperl | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-plpython3 | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-private-devel | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-private-libs | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-server | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-server-devel | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-static | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-test | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-test-rpm-macros | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-upgrade | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 10 | postgresql18-upgrade-devel | Fixed | 0:18.3-1.el10_2 | RHSA-2026:19009 |
| Red Hat Enterprise Linux 9 | postgresql18 | Fix pending Affected | ||
| AlmaLinux 10 | postgresql18 | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-contrib | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-docs | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-plperl | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-plpython3 | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-private-devel | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-private-libs | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-server | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-server-devel | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-static | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-test | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-test-rpm-macros | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-upgrade | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| AlmaLinux 10 | postgresql18-upgrade-devel | Fixed | 18.3-1.el10_2 | ALSA-2026:19009 |
| Rocky Linux 10 | postgresql18 | Fixed | 0:18.3-1.el10 | RLSA-2026:19009 |
| Alpine Linux 3.24 | postgresql16 | Fixed | 16.12-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.24 | postgresql17 | Fixed | 17.9-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.24 | postgresql18 | Fixed | 18.2-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.23 | postgresql16 | Fixed | 16.13-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.23 | postgresql17 | Fixed | 17.8-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.23 | postgresql18 | Fixed | 18.2-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.22 | postgresql15 | Fixed | 15.16-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.22 | postgresql16 | Fixed | 16.12-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.22 | postgresql17 | Fixed | 17.9-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.21 | postgresql15 | Fixed | 15.17-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.21 | postgresql16 | Fixed | 16.12-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.21 | postgresql17 | Fixed | 17.8-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.20 | postgresql15 | Fixed | 15.16-r0 | ALPINE-CVE-2026-2007 |
| Alpine Linux 3.20 | postgresql16 | Fixed | 16.12-r0 | ALPINE-CVE-2026-2007 |
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.
- PostgreSQL: affected: 18 to before 18.2; fixed in
18.2
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.