CVEfocus › CVE database › CVE-2023-39418

CVE-2023-39418Postgresql: merge fails to enforce update or select row security policies

CVSS 3.1 LowEPSS 1.1% (higher than 64% of CVEs)Published 2023-08-11Updated 2026-11-07Assigner: redhat

A vulnerability was found in PostgreSQL with the use of the MERGE command, which fails to test new rows against row security policies defined for UPDATE and SELECT. If UPDATE and SELECT policies forbid some rows that INSERT policies do not forbid, a user could store such rows.

CWE-1220

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.

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

101Fixed
2Fix pending
24Not 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 22.04postgresql-14Not affected
vulnerable_code_not_present
Ubuntu 20.04postgresql-12Not affected
vulnerable_code_not_present
Ubuntu 16.04postgresql-9.5Fix pending
Ubuntu 14.04postgresql-9.1Fix pending
Debian 12postgresql-15Fixed15.5-0+deb12u1DEBIAN-CVE-2023-39418
Red Hat Enterprise Linux 9pg_repackFixed0:1.4.8-1.module+el9.2.0+17405+aeb9ec60RHSA-2023:7785
Red Hat Enterprise Linux 9pgauditFixed0:1.7.0-1.module+el9.2.0+17405+aeb9ec60RHSA-2023:7785
Red Hat Enterprise Linux 9postgres-decoderbufsFixed0:1.9.7-1.Final.module+el9.2.0+17405+aeb9ec60RHSA-2023:7785
Red Hat Enterprise Linux 9postgresqlFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-contribFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-docsFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-plperlFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-plpython3Fixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-pltclFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-private-develFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-private-libsFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-serverFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-server-develFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-staticFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-testFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-test-rpm-macrosFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-upgradeFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 9postgresql-upgrade-develFixed0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9RHSA-2023:7785
Red Hat Enterprise Linux 8pg_repackFixed0:1.4.8-1.module+el8.9.0+19797+c4ce5969RHSA-2023:7884
Red Hat Enterprise Linux 8pgauditFixed0:1.7.0-1.module+el8.9.0+19797+c4ce5969RHSA-2023:7884
Red Hat Enterprise Linux 8postgres-decoderbufsFixed0:1.9.7-1.Final.module+el8.9.0+19797+c4ce5969RHSA-2023:7884
Red Hat Enterprise Linux 8postgresqlFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-contribFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-docsFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-plperlFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-plpython3Fixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-pltclFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-private-develFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-private-libsFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-serverFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-server-develFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-staticFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-testFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-test-rpm-macrosFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-upgradeFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
Red Hat Enterprise Linux 8postgresql-upgrade-develFixed0:15.5-1.module+el8.9.0+20663+03952ce4RHSA-2023:7884
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 9pg_repackFixed1.4.8-1.module_el9.2.0+22+09653793ALSA-2023:7785
AlmaLinux 9pgauditFixed1.7.0-1.module_el9.2.0+22+09653793ALSA-2023:7785
AlmaLinux 9postgres-decoderbufsFixed1.9.7-1.Final.module_el9.2.0+22+09653793ALSA-2023:7785
AlmaLinux 9postgresqlFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-contribFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-docsFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-plperlFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-plpython3Fixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-pltclFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-private-develFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-private-libsFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-serverFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-server-develFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-staticFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-testFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-test-rpm-macrosFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-upgradeFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 9postgresql-upgrade-develFixed15.5-1.module_el9.3.0+52+21733919ALSA-2023:7785
AlmaLinux 8pg_repackFixed1.4.8-1.module_el8.8.0+3487+43ec1b9fALSA-2023:7884
AlmaLinux 8pgauditFixed1.7.0-1.module_el8.8.0+3487+43ec1b9fALSA-2023:7884
AlmaLinux 8postgres-decoderbufsFixed1.9.7-1.Final.module_el8.8.0+3487+43ec1b9fALSA-2023:7884
AlmaLinux 8postgresqlFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-contribFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-docsFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-plperlFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-plpython3Fixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-pltclFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-private-develFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-private-libsFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-serverFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-server-develFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-staticFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-testFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-test-rpm-macrosFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-upgradeFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
AlmaLinux 8postgresql-upgrade-develFixed15.5-1.module_el8.9.0+3706+885c732eALSA-2023:7884
Rocky Linux 9pgauditFixed0:1.7.0-1.module+el9.5.0+30637+4391fccaRLSA-2023:7785
Rocky Linux 9postgres-decoderbufsFixed0:1.9.7-1.Final.module+el9.5.0+30637+4391fccaRLSA-2023:7785
Rocky Linux 8pg_repackFixed0:1.4.8-1.module+el8.9.0+1525+fc91df60RLSA-2023:7884
Rocky Linux 8pgauditFixed0:1.7.0-1.module+el8.10.0+40056+df351139RLSA-2023:7884
Rocky Linux 8postgres-decoderbufsFixed0:1.9.7-1.Final.module+el8.10.0+40056+df351139RLSA-2023:7884
Alpine Linux 3.22postgresql15Fixed15.4-r0ALPINE-CVE-2023-39418
Alpine Linux 3.21postgresql15Fixed15.4-r0ALPINE-CVE-2023-39418
Alpine Linux 3.20postgresql14Fixed14.9-r0ALPINE-CVE-2023-39418
Alpine Linux 3.20postgresql15Fixed15.4-r0ALPINE-CVE-2023-39418
Alpine Linux 3.19postgresql13Fixed13.12-r0ALPINE-CVE-2023-39418
Alpine Linux 3.19postgresql14Fixed14.9-r0ALPINE-CVE-2023-39418
Alpine Linux 3.19postgresql15Fixed15.4-r0ALPINE-CVE-2023-39418
Alpine Linux 3.18postgresql12Fixed12.16-r0ALPINE-CVE-2023-39418
Alpine Linux 3.18postgresql13Fixed13.12-r0ALPINE-CVE-2023-39418
Alpine Linux 3.18postgresql14Fixed14.9-r0ALPINE-CVE-2023-39418
Alpine Linux 3.18postgresql15Fixed15.4-r0ALPINE-CVE-2023-39418
Alpine Linux 3.17postgresql12Fixed12.16-r0ALPINE-CVE-2023-39418
Alpine Linux 3.17postgresql13Fixed13.12-r0ALPINE-CVE-2023-39418
Alpine Linux 3.17postgresql14Fixed14.9-r0ALPINE-CVE-2023-39418
Alpine Linux 3.17postgresql15Fixed15.4-r0ALPINE-CVE-2023-39418
Alpine Linux 3.16postgresql12Fixed12.16-r0ALPINE-CVE-2023-39418
Alpine Linux 3.16postgresql13Fixed13.12-r0ALPINE-CVE-2023-39418
Alpine Linux 3.16postgresql14Fixed14.9-r0ALPINE-CVE-2023-39418
Alpine Linux 3.15postgresql12Fixed12.16-r0ALPINE-CVE-2023-39418
Alpine Linux 3.15postgresql13Fixed13.12-r0ALPINE-CVE-2023-39418
Alpine Linux 3.15postgresql14Fixed14.9-r0ALPINE-CVE-2023-39418
Alpine Linux 3.14postgresqlFixed13.12-r0ALPINE-CVE-2023-39418
Alpine Linux 3.13postgresqlFixed13.12-r0ALPINE-CVE-2023-39418

What the vendor says

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

Vendor advisories:

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.