Skip to content
Fencer Vulns
low 3.1

CVE-2023-39418 json

Postgresql: merge fails to enforce update or select row security policies

published 2023-08-11 3 y ago modified 2026-11-07 39 h ago also BIT-postgresql-2023-39418 , EUVD-2023-43142

cvss
3.1
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
1.1%
EPSS 1.1% chance of exploitation in 30 days, percentile 65%
public exploits
0
none known

Summary

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.

Patch / fix

  • bitnami postgresql 15.4.0
  • Red Hat Red Hat Enterprise Linux 8 8090020231114113548.a75119d5
  • Red Hat Red Hat Enterprise Linux 8.8 Extended Update Support 8080020231113134015.63b34585
  • Red Hat Red Hat Enterprise Linux 9 9030020231120082734.rhel9
  • Red Hat Red Hat Enterprise Linux 9.2 Extended Update Support 9020020231115020618.rhel9
  • postgresql-15 Debian 12 15.5-0+deb12u1

debian advisories DEBIAN-CVE-2023-39418

  • pgaudit RHEL 9, RHEL 9.2 EUS 1.7.0-1.module+el9.2.0+17405+aeb9ec60
  • pg_repack RHEL 9, RHEL 9.2 EUS 1.4.8-1.module+el9.2.0+17405+aeb9ec60
  • postgresql RHEL 9, RHEL 9.2 EUS 15.5-1.module+el9.2.0.z+20667+a2d2a8a9
  • postgresql-test RHEL 9, RHEL 9.2 EUS 15.5-1.module+el9.2.0.z+20667+a2d2a8a9
  • postgresql-pltcl RHEL 9, RHEL 9.2 EUS 15.5-1.module+el9.2.0.z+20667+a2d2a8a9
  • postgresql-plperl RHEL 9, RHEL 9.2 EUS 15.5-1.module+el9.2.0.z+20667+a2d2a8a9
  • postgresql-server RHEL 9, RHEL 9.2 EUS 15.5-1.module+el9.2.0.z+20667+a2d2a8a9
  • postgresql-contrib RHEL 9, RHEL 9.2 EUS 15.5-1.module+el9.2.0.z+20667+a2d2a8a9

red hat advisories RHSA-2023:7885RHSA-2023:7884RHSA-2023:7883RHSA-2023:7785

  • postgresql15 SLE Module for Server Applications 15 SP5, SLE Module for Server Applications 15 SP4, SLE Module for Package Hub 15 SP4 +6 more 15.4-150200.5.12.1
  • postgresql15 SLES for SAP 12 SP5, SLES 12 SP5, SLE Software Development Kit 12 SP5 15.4-3.12.1

suse advisories SUSE-SU-2023:3347-1SUSE-SU-2023:3342-1

  • postgresql15 openSUSE Tumbleweed 15.4-1.1

opensuse advisories openSUSE-SU-2024:13134-1

  • pgaudit AlmaLinux 8 1.7.0-1.module_el8.8.0+3487+43ec1b9f
  • pg_repack AlmaLinux 8 1.4.8-1.module_el8.8.0+3487+43ec1b9f
  • postgresql AlmaLinux 8 15.5-1.module_el8.9.0+3706+885c732e
  • postgresql-test AlmaLinux 8 15.5-1.module_el8.9.0+3706+885c732e
  • postgresql-pltcl AlmaLinux 8 15.5-1.module_el8.9.0+3706+885c732e
  • postgresql-plperl AlmaLinux 8 15.5-1.module_el8.9.0+3706+885c732e
  • postgresql-server AlmaLinux 8 15.5-1.module_el8.9.0+3706+885c732e
  • postgresql-contrib AlmaLinux 8 15.5-1.module_el8.9.0+3706+885c732e

almalinux advisories ALSA-2023:7884ALSA-2023:7785

  • pgaudit Rocky Linux 8 1.7.0-1.module+el8.10.0+40056+df351139
  • pgaudit Rocky Linux 8 1.7.0-1.module+el8.9.0+1525+fc91df60
  • pg_repack Rocky Linux 8 1.4.8-1.module+el8.9.0+1525+fc91df60
  • pg_repack Rocky Linux 8 1.4.8-1.module+el8.10.0+40056+df351139
  • pg_repack Rocky Linux 8 1.4.8-1.module+el8.10.0+1858+fcc46a79
  • pg_repack Rocky Linux 8 1.4.8-1.module+el8.10.0+1622+bd25b19c
  • postgres-decoderbufs Rocky Linux 8 1.9.7-1.Final.module+el8.10.0+40056+df351139
  • postgres-decoderbufs Rocky Linux 8 1.9.7-1.Final.module+el8.9.0+1525+fc91df60

rocky linux advisories RLSA-2023:7884RLSA-2023:7785

  • postgresql Alpine 3.14, Alpine 3.13 13.12-r0
  • postgresql12 Alpine 3.18, Alpine 3.17, Alpine 3.16 +1 more 12.16-r0
  • postgresql13 Alpine 3.19, Alpine 3.18, Alpine 3.17 +2 more 13.12-r0
  • postgresql14 Alpine 3.20, Alpine 3.19, Alpine 3.18 +3 more 14.9-r0
  • postgresql15 Alpine 3.22, Alpine 3.21, Alpine 3.20 +3 more 15.4-r0

alpine advisories ALPINE-CVE-2023-39418

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2023-39418 updated cvss 3.1

postgresql: MERGE fails to enforce UPDATE or SELECT row security policies

  • Red Hat Enterprise Linux AppStream (v. 8) pgaudit 1.7.0-1.module+el8.9.0+19797+c4ce5969, pg_repack 1.4.8-1.module+el8.9.0+19797+c4ce5969, postgresql 15.5-1.module+el8.9.0+20663+03952ce4, postgresql-test 15.5-1.module+el8.9.0+20663+03952ce4, postgresql-pltcl 15.5-1.module+el8.9.0+20663+03952ce4, postgresql-plperl 15.5-1.module+el8.9.0+20663+03952ce4, +7 more
    fixed: vendor fix RHSA-2023:7884
  • Red Hat Enterprise Linux AppStream (v. 9) pgaudit 1.7.0-1.module+el9.2.0+17405+aeb9ec60, pg_repack 1.4.8-1.module+el9.2.0+17405+aeb9ec60, postgresql 15.5-1.module+el9.2.0.z+20667+a2d2a8a9, postgresql-test 15.5-1.module+el9.2.0.z+20667+a2d2a8a9, postgresql-pltcl 15.5-1.module+el9.2.0.z+20667+a2d2a8a9, postgresql-plperl 15.5-1.module+el9.2.0.z+20667+a2d2a8a9, +7 more
    fixed: vendor fix RHSA-2023:7785
  • Red Hat Enterprise Linux AppStream EUS (v.8.8) pgaudit 1.7.0-1.module+el8.8.0+17071+aaaceaa4, pg_repack 1.4.8-1.module+el8.8.0+17071+aaaceaa4, postgresql 15.5-1.module+el8.8.0+20658+5fb3eedd, postgresql-test 15.5-1.module+el8.8.0+20658+5fb3eedd, postgresql-pltcl 15.5-1.module+el8.8.0+20658+5fb3eedd, postgresql-plperl 15.5-1.module+el8.8.0+20658+5fb3eedd, +7 more
    fixed: vendor fix RHSA-2023:7883
  • Red Hat Enterprise Linux AppStream EUS (v.9.2) pgaudit 1.7.0-1.module+el9.2.0+17405+aeb9ec60, pg_repack 1.4.8-1.module+el9.2.0+17405+aeb9ec60, postgresql 15.5-1.module+el9.2.0.z+20667+a2d2a8a9, postgresql-test 15.5-1.module+el9.2.0.z+20667+a2d2a8a9, postgresql-pltcl 15.5-1.module+el9.2.0.z+20667+a2d2a8a9, postgresql-plperl 15.5-1.module+el9.2.0.z+20667+a2d2a8a9, +7 more
    fixed: vendor fix RHSA-2023:7885
  • Red Hat Enterprise Linux 6 postgresql, postgresql-libs, postgresql-test, postgresql-pltcl, postgresql-plperl, postgresql-server, +2 more Red Hat Enterprise Linux 7 postgresql, postgresql-libs, postgresql-test, postgresql-pltcl, postgresql-plperl, postgresql-server, +3 more Red Hat Enterprise Linux 8 pgaudit, pg_repack, postgresql, postgresql-test, postgresql-pltcl, postgresql-plperl, +7 more Red Hat Enterprise Linux 9 postgresql, postgresql-test, postgresql-pltcl, postgresql-plperl, postgresql-server, postgresql-contrib, +4 more Red Hat Software Collections rh-postgresql10-postgresql, rh-postgresql12-postgresql, rh-postgresql13-postgresql, rh-postgresql10-postgresql-libs, rh-postgresql10-postgresql-test, rh-postgresql12-postgresql-libs, +28 more
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
partial
Assessed
2 y ago

Exploit prediction

1.09% chance of exploitation in the next 30 days, higher than 65% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 3.1 CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
NVD 3.1 4.3 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
OSV 3.1 4.3 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N

Affected packages

ecosystem package affected fixed in
bitnami postgresql
>=15.0.0, <15.4.0
15.4.0

Affected products

  • Red Hat Red Hat Enterprise Linux 8
  • Red Hat Red Hat Enterprise Linux 8.8 Extended Update Support
  • Red Hat Red Hat Enterprise Linux 9
  • Red Hat Red Hat Enterprise Linux 9.2 Extended Update Support
  • Red Hat Red Hat Enterprise Linux 6
  • Red Hat Red Hat Enterprise Linux 7
  • Red Hat Red Hat Software Collections

Classification

Weakness
  • CWE-1220 Insufficient Granularity of Access Control
Technology feeds

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.