CVEfocus › CVE database › CVE-2026-16238

CVE-2026-16238PostgreSQL type confusion in pg_restore_attribute_stats() executes arbitrary code

CVSS 8.8 HighEPSS 0.6% (higher than 43% of CVEs)Published 2026-08-13Updated 2026-08-29Assigner: PostgreSQL

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.

CWE-843

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

82Fixed
1Fix pending
58Not 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.6-0ubuntu0.26.04.1UBUNTU-CVE-2026-16238
Ubuntu 24.04postgresql-16Not affected
vulnerable_code_not_present
Ubuntu 22.04postgresql-14Not affected
vulnerable_code_not_present
Ubuntu 14.04postgresql-9.3Fix pendingUBUNTU-CVE-2026-16238
Debian 14postgresql-18Fixed18.6-1DEBIAN-CVE-2026-16238
Red Hat Enterprise Linux 10postgresqlNot affected
Red Hat Enterprise Linux 10postgresql-contribNot affected
Red Hat Enterprise Linux 10postgresql-docsNot affected
Red Hat Enterprise Linux 10postgresql-plperlNot affected
Red Hat Enterprise Linux 10postgresql-plpython3Not affected
Red Hat Enterprise Linux 10postgresql-pltclNot affected
Red Hat Enterprise Linux 10postgresql-private-develNot affected
Red Hat Enterprise Linux 10postgresql-private-libsNot affected
Red Hat Enterprise Linux 10postgresql-serverNot affected
Red Hat Enterprise Linux 10postgresql-server-develNot affected
Red Hat Enterprise Linux 10postgresql-staticNot affected
Red Hat Enterprise Linux 10postgresql-testNot affected
Red Hat Enterprise Linux 10postgresql-test-rpm-macrosNot affected
Red Hat Enterprise Linux 10postgresql-upgradeNot affected
Red Hat Enterprise Linux 10postgresql-upgrade-develNot affected
Red Hat Enterprise Linux 10postgresql16Not affected
Red Hat Enterprise Linux 10postgresql18Fixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-contribFixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-docsFixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-plperlFixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-plpython3Fixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-private-develFixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-private-libsFixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-serverFixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-server-develFixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-staticFixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-testFixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-test-rpm-macrosFixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-upgradeFixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 10postgresql18-upgrade-develFixed0:18.6-1.el10_2RHSA-2026:67280
Red Hat Enterprise Linux 9pg_repackFixed0:1.5.3-1.module+el9.8.0+23739+1c42644cRHSA-2026:67848
Red Hat Enterprise Linux 9pgauditFixed0:18.0-1.module+el9.8.0+23739+1c42644cRHSA-2026:67848
Red Hat Enterprise Linux 9pgvectorFixed0:0.8.1-1.module+el9.8.0+23739+1c42644cRHSA-2026:67848
Red Hat Enterprise Linux 9postgisFixed0:3.6.1-4.module+el9.8.0+24879+1364ef12RHSA-2026:67848
Red Hat Enterprise Linux 9postgis-clientFixed0:3.6.1-4.module+el9.8.0+24879+1364ef12RHSA-2026:67848
Red Hat Enterprise Linux 9postgis-docsFixed0:3.6.1-4.module+el9.8.0+24879+1364ef12RHSA-2026:67848
Red Hat Enterprise Linux 9postgis-upgradeFixed0:3.6.1-4.module+el9.8.0+24879+1364ef12RHSA-2026:67848
Red Hat Enterprise Linux 9postgis-utilsFixed0:3.6.1-4.module+el9.8.0+24879+1364ef12RHSA-2026:67848
Red Hat Enterprise Linux 9postgres-decoderbufsFixed0:3.3.1-1.Final.module+el9.8.0+23739+1c42644cRHSA-2026:67848
Red Hat Enterprise Linux 9postgresqlFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-contribFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-docsFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-plperlFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-plpython3Fixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-pltclFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-private-develFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-private-libsFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-serverFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-server-develFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-staticFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-testFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-test-rpm-macrosFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-upgradeFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 9postgresql-upgrade-develFixed0:18.6-1.module+el9.8.0+24816+5c11f535RHSA-2026:67848
Red Hat Enterprise Linux 8pg_repackNot affected
Red Hat Enterprise Linux 8pgauditNot affected
Red Hat Enterprise Linux 8postgres-decoderbufsNot affected
Red Hat Enterprise Linux 8postgresqlNot affected
Red Hat Enterprise Linux 8postgresql-contribNot affected
Red Hat Enterprise Linux 8postgresql-docsNot affected
Red Hat Enterprise Linux 8postgresql-plperlNot affected
Red Hat Enterprise Linux 8postgresql-plpython3Not affected
Red Hat Enterprise Linux 8postgresql-pltclNot affected
Red Hat Enterprise Linux 8postgresql-private-develNot affected
Red Hat Enterprise Linux 8postgresql-private-libsNot affected
Red Hat Enterprise Linux 8postgresql-serverNot affected
Red Hat Enterprise Linux 8postgresql-server-develNot affected
Red Hat Enterprise Linux 8postgresql-staticNot affected
Red Hat Enterprise Linux 8postgresql-testNot affected
Red Hat Enterprise Linux 8postgresql-test-rpm-macrosNot affected
Red Hat Enterprise Linux 8postgresql-upgradeNot affected
Red Hat Enterprise Linux 8postgresql-upgrade-develNot affected
Red Hat Enterprise Linux 7postgresqlNot affected
Red Hat Enterprise Linux 7postgresql-contribNot affected
Red Hat Enterprise Linux 7postgresql-develNot affected
Red Hat Enterprise Linux 7postgresql-docsNot affected
Red Hat Enterprise Linux 7postgresql-libsNot affected
Red Hat Enterprise Linux 7postgresql-plperlNot affected
Red Hat Enterprise Linux 7postgresql-plpythonNot affected
Red Hat Enterprise Linux 7postgresql-pltclNot affected
Red Hat Enterprise Linux 7postgresql-serverNot affected
Red Hat Enterprise Linux 7postgresql-staticNot affected
Red Hat Enterprise Linux 7postgresql-testNot affected
Red Hat Enterprise Linux 7postgresql-upgradeNot affected
Red Hat Enterprise Linux 6postgresqlNot affected
Red Hat Enterprise Linux 6postgresql-contribNot affected
Red Hat Enterprise Linux 6postgresql-develNot affected
Red Hat Enterprise Linux 6postgresql-docsNot affected
Red Hat Enterprise Linux 6postgresql-libsNot affected
Red Hat Enterprise Linux 6postgresql-plperlNot affected
Red Hat Enterprise Linux 6postgresql-plpythonNot affected
Red Hat Enterprise Linux 6postgresql-pltclNot affected
Red Hat Enterprise Linux 6postgresql-serverNot affected
Red Hat Enterprise Linux 6postgresql-testNot affected
AlmaLinux 10postgresql18-test-rpm-macrosFixed18.6-1.el10_2ALSA-2026:67280
AlmaLinux 9pg_repackFixed1.5.3-1.module_el9.8.0+234+5456f35dALSA-2026:67848
AlmaLinux 9pgauditFixed18.0-1.module_el9.8.0+234+5456f35dALSA-2026:67848
AlmaLinux 9pgvectorFixed0.8.1-1.module_el9.8.0+234+5456f35dALSA-2026:67848
AlmaLinux 9postgisFixed3.6.1-4.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgis-clientFixed3.6.1-4.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgis-docsFixed3.6.1-4.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgis-upgradeFixed3.6.1-4.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgis-utilsFixed3.6.1-4.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgres-decoderbufsFixed3.3.1-1.Final.module_el9.8.0+234+5456f35dALSA-2026:67848
AlmaLinux 9postgresqlFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-contribFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-docsFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-plperlFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-plpython3Fixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-pltclFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-private-develFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-private-libsFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-serverFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-server-develFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-staticFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-testFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-test-rpm-macrosFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-upgradeFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
AlmaLinux 9postgresql-upgrade-develFixed18.6-1.module_el9.8.0+310+22372bccALSA-2026:67848
Rocky Linux 10postgresql18Fixed0:18.6-1.el10_2RLSA-2026:67280
Rocky Linux 9pg_repackFixed0:1.5.3-1.module+el9.8.0+40158+490b3c67RLSA-2026:67848
Rocky Linux 9pgauditFixed0:18.0-1.module+el9.8.0+40213+f1e225a4RLSA-2026:67848
Rocky Linux 9pgvectorFixed0:0.8.1-1.module+el9.8.0+40213+f1e225a4RLSA-2026:67848
Rocky Linux 9postgres-decoderbufsFixed0:3.3.1-1.Final.module+el9.8.0+40213+f1e225a4RLSA-2026:67848
Alpine Linux 3.24postgresql16Fixed16.15-r0ALPINE-CVE-2026-16238
Alpine Linux 3.24postgresql17Fixed17.11-r0ALPINE-CVE-2026-16238
Alpine Linux 3.24postgresql18Fixed18.5-r0ALPINE-CVE-2026-16238
Alpine Linux 3.23postgresql16Fixed16.15-r0ALPINE-CVE-2026-16238
Alpine Linux 3.23postgresql17Fixed17.11-r0ALPINE-CVE-2026-16238
Alpine Linux 3.23postgresql18Fixed18.5-r0ALPINE-CVE-2026-16238
Alpine Linux 3.22postgresql15Fixed15.19-r0ALPINE-CVE-2026-16238
Alpine Linux 3.22postgresql16Fixed16.15-r0ALPINE-CVE-2026-16238
Alpine Linux 3.22postgresql17Fixed17.11-r0ALPINE-CVE-2026-16238
Alpine Linux 3.21postgresql15Fixed15.19-r0ALPINE-CVE-2026-16238
Alpine Linux 3.21postgresql16Fixed16.15-r0ALPINE-CVE-2026-16238
Alpine Linux 3.21postgresql17Fixed17.11-r0ALPINE-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.

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.