CVE-2026-16238PostgreSQL type confusion in pg_restore_attribute_stats() executes arbitrary code
Type confusion in PostgreSQL pg_restore_attribute_stats() allows an object creator to execute arbitrary code as the operating system user running the database, via conflation of range and multirange values. Within major version 18, minor versions before PostgreSQL 18.6 are affected. Versions before PostgreSQL 18 are unaffected.
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
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 | Fixed | 18.6-0ubuntu0.26.04.1 | UBUNTU-CVE-2026-16238 |
| 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-16238 | |
| Debian 14 | postgresql-18 | Fixed | 18.6-1 | DEBIAN-CVE-2026-16238 |
| Red Hat Enterprise Linux 10 | postgresql | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-contrib | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-docs | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-plperl | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-plpython3 | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-pltcl | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-private-devel | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-private-libs | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-server | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-server-devel | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-static | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-test | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-test-rpm-macros | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-upgrade | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql-upgrade-devel | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql16 | Not affected | ||
| Red Hat Enterprise Linux 10 | postgresql18 | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-contrib | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-docs | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-plperl | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-plpython3 | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-private-devel | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-private-libs | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-server | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-server-devel | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-static | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-test | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-test-rpm-macros | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-upgrade | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 10 | postgresql18-upgrade-devel | Fixed | 0:18.6-1.el10_2 | RHSA-2026:67280 |
| Red Hat Enterprise Linux 9 | pg_repack | Fixed | 0:1.5.3-1.module+el9.8.0+23739+1c42644c | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | pgaudit | Fixed | 0:18.0-1.module+el9.8.0+23739+1c42644c | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | pgvector | Fixed | 0:0.8.1-1.module+el9.8.0+23739+1c42644c | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgis | Fixed | 0:3.6.1-4.module+el9.8.0+24879+1364ef12 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgis-client | Fixed | 0:3.6.1-4.module+el9.8.0+24879+1364ef12 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgis-docs | Fixed | 0:3.6.1-4.module+el9.8.0+24879+1364ef12 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgis-upgrade | Fixed | 0:3.6.1-4.module+el9.8.0+24879+1364ef12 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgis-utils | Fixed | 0:3.6.1-4.module+el9.8.0+24879+1364ef12 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgres-decoderbufs | Fixed | 0:3.3.1-1.Final.module+el9.8.0+23739+1c42644c | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-contrib | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-docs | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-plperl | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-plpython3 | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-pltcl | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-private-devel | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-private-libs | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-server | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-server-devel | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-static | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-test | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-test-rpm-macros | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-upgrade | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 9 | postgresql-upgrade-devel | Fixed | 0:18.6-1.module+el9.8.0+24816+5c11f535 | RHSA-2026:67848 |
| Red Hat Enterprise Linux 8 | pg_repack | Not affected | ||
| Red Hat Enterprise Linux 8 | pgaudit | Not affected | ||
| Red Hat Enterprise Linux 8 | postgres-decoderbufs | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-contrib | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-docs | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-plperl | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-plpython3 | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-pltcl | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-private-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-private-libs | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-server | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-server-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-static | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-test | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-test-rpm-macros | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-upgrade | Not affected | ||
| Red Hat Enterprise Linux 8 | postgresql-upgrade-devel | Not affected | ||
| Red Hat Enterprise Linux 7 | postgresql | Not affected | ||
| Red Hat Enterprise Linux 7 | postgresql-contrib | Not affected | ||
| Red Hat Enterprise Linux 7 | postgresql-devel | Not affected | ||
| Red Hat Enterprise Linux 7 | postgresql-docs | Not affected | ||
| Red Hat Enterprise Linux 7 | postgresql-libs | Not affected | ||
| Red Hat Enterprise Linux 7 | postgresql-plperl | Not affected | ||
| Red Hat Enterprise Linux 7 | postgresql-plpython | Not affected | ||
| Red Hat Enterprise Linux 7 | postgresql-pltcl | Not affected | ||
| Red Hat Enterprise Linux 7 | postgresql-server | Not affected | ||
| Red Hat Enterprise Linux 7 | postgresql-static | Not affected | ||
| Red Hat Enterprise Linux 7 | postgresql-test | Not affected | ||
| Red Hat Enterprise Linux 7 | postgresql-upgrade | Not affected | ||
| Red Hat Enterprise Linux 6 | postgresql | Not affected | ||
| Red Hat Enterprise Linux 6 | postgresql-contrib | Not affected | ||
| Red Hat Enterprise Linux 6 | postgresql-devel | Not affected | ||
| Red Hat Enterprise Linux 6 | postgresql-docs | Not affected | ||
| Red Hat Enterprise Linux 6 | postgresql-libs | Not affected | ||
| Red Hat Enterprise Linux 6 | postgresql-plperl | Not affected | ||
| Red Hat Enterprise Linux 6 | postgresql-plpython | Not affected | ||
| Red Hat Enterprise Linux 6 | postgresql-pltcl | Not affected | ||
| Red Hat Enterprise Linux 6 | postgresql-server | Not affected | ||
| Red Hat Enterprise Linux 6 | postgresql-test | Not affected | ||
| AlmaLinux 10 | postgresql18-test-rpm-macros | Fixed | 18.6-1.el10_2 | ALSA-2026:67280 |
| AlmaLinux 9 | pg_repack | Fixed | 1.5.3-1.module_el9.8.0+234+5456f35d | ALSA-2026:67848 |
| AlmaLinux 9 | pgaudit | Fixed | 18.0-1.module_el9.8.0+234+5456f35d | ALSA-2026:67848 |
| AlmaLinux 9 | pgvector | Fixed | 0.8.1-1.module_el9.8.0+234+5456f35d | ALSA-2026:67848 |
| AlmaLinux 9 | postgis | Fixed | 3.6.1-4.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgis-client | Fixed | 3.6.1-4.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgis-docs | Fixed | 3.6.1-4.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgis-upgrade | Fixed | 3.6.1-4.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgis-utils | Fixed | 3.6.1-4.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgres-decoderbufs | Fixed | 3.3.1-1.Final.module_el9.8.0+234+5456f35d | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-contrib | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-docs | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-plperl | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-plpython3 | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-pltcl | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-private-devel | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-private-libs | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-server | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-server-devel | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-static | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-test | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-test-rpm-macros | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-upgrade | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| AlmaLinux 9 | postgresql-upgrade-devel | Fixed | 18.6-1.module_el9.8.0+310+22372bcc | ALSA-2026:67848 |
| Rocky Linux 10 | postgresql18 | Fixed | 0:18.6-1.el10_2 | RLSA-2026:67280 |
| Rocky Linux 9 | pg_repack | Fixed | 0:1.5.3-1.module+el9.8.0+40158+490b3c67 | RLSA-2026:67848 |
| Rocky Linux 9 | pgaudit | Fixed | 0:18.0-1.module+el9.8.0+40213+f1e225a4 | RLSA-2026:67848 |
| Rocky Linux 9 | pgvector | Fixed | 0:0.8.1-1.module+el9.8.0+40213+f1e225a4 | RLSA-2026:67848 |
| Rocky Linux 9 | postgres-decoderbufs | Fixed | 0:3.3.1-1.Final.module+el9.8.0+40213+f1e225a4 | RLSA-2026:67848 |
| Alpine Linux 3.24 | postgresql16 | Fixed | 16.15-r0 | ALPINE-CVE-2026-16238 |
| Alpine Linux 3.24 | postgresql17 | Fixed | 17.11-r0 | ALPINE-CVE-2026-16238 |
| Alpine Linux 3.24 | postgresql18 | Fixed | 18.5-r0 | ALPINE-CVE-2026-16238 |
| Alpine Linux 3.23 | postgresql16 | Fixed | 16.15-r0 | ALPINE-CVE-2026-16238 |
| Alpine Linux 3.23 | postgresql17 | Fixed | 17.11-r0 | ALPINE-CVE-2026-16238 |
| Alpine Linux 3.23 | postgresql18 | Fixed | 18.5-r0 | ALPINE-CVE-2026-16238 |
| Alpine Linux 3.22 | postgresql15 | Fixed | 15.19-r0 | ALPINE-CVE-2026-16238 |
| Alpine Linux 3.22 | postgresql16 | Fixed | 16.15-r0 | ALPINE-CVE-2026-16238 |
| Alpine Linux 3.22 | postgresql17 | Fixed | 17.11-r0 | ALPINE-CVE-2026-16238 |
| Alpine Linux 3.21 | postgresql15 | Fixed | 15.19-r0 | ALPINE-CVE-2026-16238 |
| Alpine Linux 3.21 | postgresql16 | Fixed | 16.15-r0 | ALPINE-CVE-2026-16238 |
| Alpine Linux 3.21 | postgresql17 | Fixed | 17.11-r0 | ALPINE-CVE-2026-16238 |
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.6; fixed in
18.6
Workaround: Revoke public EXECUTE permission on the function
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.