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

Published Aug 1, 2023
·
Updated

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.

Other sources

PostgreSQL 15 introduced 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 row that INSERT policies do not forbid, a user could store such rows. Subsequent consequences are application-dependent. This affects only databases that have used CREATE POLICY to define a row security policy.

Vulnerable Version: 15

Red Hat

PostgreSQL could allow a remote authenticated attacker to bypass security restrictions, caused by failing to enforce UPDATE or SELECT row security policies in MERGE command. By sending a specially crafted request, an attacker could exploit this vulnerability to bypass access restrictions.

IBM

Affected Software

7 affected componentsFixes available
debian/postgresql-13
13.16-0+deb11u1
debian/postgresql-15
15.8-0+deb12u1
redhat/postgresql<15.4
15.4
PostgreSQL postgresql>=15.0<15.4
redhat Enterprise Linux=8.0
redhat Enterprise Linux=9.0
Debian Debian Linux=12.0

Event History

Aug 1, 2023
Data Sourced
via Red Hat·12:31 PM
DescriptionSeverityAffected Software
Aug 11, 2023
CVE Published
via MITRE·12:19 PM
Data Sourced
via MITRE·12:19 PM
DescriptionSeverityWeakness
Jan 12, 2024
Data Sourced
via Launchpad·12:24 AM
Description
Mar 28, 2024
Data Sourced
via IBM·12:00 AM
DescriptionSeverityAffected Software
Sep 16, 2024
Data Sourced
via Ubuntu·02:17 AM
RemedyDescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the vulnerability ID?

The vulnerability ID is CVE-2023-39418.

2

What is the severity level of CVE-2023-39418?

The severity level of CVE-2023-39418 is medium (4.3).

3

What is the affected software of CVE-2023-39418?

The affected software of CVE-2023-39418 is PostgreSQL version 15.4 and below on Redhat Enterprise Linux 8.0 and 9.0, and PostgreSQL versions 11, 13, and 15 on Debian and Ubuntu.

4

What is the description of CVE-2023-39418?

CVE-2023-39418 is a vulnerability in PostgreSQL that occurs when using the MERGE command, which fails to test new rows against row security policies defined for UPDATE and SELECT, potentially allowing a user to store forbidden rows.

5

Are there any references for CVE-2023-39418?

Yes, you can find references for CVE-2023-39418 at these links: [reference 1](https://bugzilla.redhat.com/show_bug.cgi?id=2228112), [reference 2](https://access.redhat.com/security/cve/CVE-2023-39418), and [reference 3](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=cb2ae5741f2458a474ed3c31458d242e678ff229).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203