CVE-2023-39418
Postgresql: merge fails to enforce update or select row security policies
Check your servers for CVE-2023-39418
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2023-39418 affects postgresql, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
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.
Severity (CVSS)
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- high: an attack depends on conditions outside the control of the attacker, such as a race
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality none, integrity low, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 1.09%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 66.2% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 19 Dec 2023):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Weakness
- CWE-1220 Insufficient Granularity of Access Control
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
|
Red Hat Enterprise Linux 8
package
postgresql:15 |
unaffected 8090020231114113548.a75119d5 and later
Other versions: affected
|
|
Red Hat Enterprise Linux 8.8 Extended Update Support
package
postgresql:15 |
unaffected 8080020231113134015.63b34585 and later
Other versions: affected
|
|
Red Hat Enterprise Linux 9
package
postgresql:15 |
unaffected 9030020231120082734.rhel9 and later
Other versions: affected
|
|
Red Hat Enterprise Linux 9.2 Extended Update Support
package
postgresql:15 |
unaffected 9020020231115020618.rhel9 and later
Other versions: affected
|
|
Red Hat Enterprise Linux 6
package
postgresql |
unaffected the record does not list versions
|
|
Red Hat Enterprise Linux 7
package
postgresql |
unaffected the record does not list versions
|
|
Red Hat Enterprise Linux 8
package
postgresql:10/postgresql |
unaffected the record does not list versions
|
|
Red Hat Enterprise Linux 8
package
postgresql:12/postgresql |
unaffected the record does not list versions
|
|
Red Hat Enterprise Linux 8
package
postgresql:13/postgresql |
unaffected the record does not list versions
|
|
Red Hat Enterprise Linux 9
package
postgresql |
unaffected the record does not list versions
|
|
Red Hat Software Collections
package
rh-postgresql10-postgresql |
unaffected the record does not list versions
|
|
Red Hat Software Collections
package
rh-postgresql12-postgresql |
unaffected the record does not list versions
|
|
Red Hat Software Collections
package
rh-postgresql13-postgresql |
unaffected the record does not list versions
|
Is my server affected?
Find the installed version of postgresql and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i postgresql
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2023-39418 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2023-39418RHEL, Rocky, Alma, Fedora
rpm -q postgresql
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2023-39418Alpine
apk list --installed | grep -i postgresqlWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2023-39418
trivy image --scanners vuln IMAGE | grep CVE-2023-39418
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- RHSA-2023:7785 access.redhat.com · vendor advisory
- RHSA-2023:7883 access.redhat.com · vendor advisory
- RHSA-2023:7884 access.redhat.com · vendor advisory
- RHSA-2023:7885 access.redhat.com · vendor advisory
- https://access.redhat.com/security/cve/CVE-2023-39418 access.redhat.com · vdb entry
- RHBZ#2228112 bugzilla.redhat.com · issue tracking
Other references
- https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=cb2ae5741f2458a474ed3c31458d242e678ff229 git.postgresql.org
- https://www.postgresql.org/support/security/CVE-2023-39418/ postgresql.org
- https://security.netapp.com/advisory/ntap-20230915-0002/ security.netapp.com
- https://www.debian.org/security/2023/dsa-5553 debian.org
Source: the record CVE-2023-39418 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse