CVE-2023-39418: Postgresql: merge fails to enforce update or select row security policies
Noroxi assessment
Priority: Monitor (action score 17/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 1% (FIRST EPSS); higher than 65.4% of all records.
- Anyone who can reach it over the internet can trigger it. A low-privileged account is enough. No user action is required. No special conditions are required; it is repeatable.
- Fixed version: pg_repack (AlmaLinux:8) 1.4.8-1.module_el8.8.0+3487+43ec1b9f; pgaudit (AlmaLinux:8) 1.7.0-1.module_el8.8.0+3487+43ec1b9f; postgres-decoderbufs (AlmaLinux:8) 1.9.7-1.Final.module_el8.8.0+3487+43ec1b9f.
Low priority for now. Upgrade to pg_repack (AlmaLinux:8) 1.4.8-1.module_el8.8.0+3487+43ec1b9f; pgaudit (AlmaLinux:8) 1.7.0-1.module_el8.8.0+3487+43ec1b9f; postgres-decoderbufs (AlmaLinux:8) 1.9.7-1.Final.module_el8.8.0+3487+43ec1b9f or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
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.
- Published
- Aug 11, 2023
- Updated
- Nov 7, 2026
- EPSS
- 1.0% · 65th percentile
- CWE
- CWE-1220
Report tools
Action score
17
Monitor
Low priority for now.
- CVSS
- 17 / 40 · 4.3 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 1.0%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- 4.3
- CNA · redhat
- 3.1
- 1.2 point gap
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Running WordPress? Scan your site free with WP Lens
Noroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| postgresql | postgresql | cpe:2.3:a:postgresql:postgresql |
| redhat | enterprise linux | cpe:2.3:o:redhat:enterprise_linux |
| debian | debian linux | cpe:2.3:o:debian:debian_linux |
Using postgresql? Add it to your stack and be the first to know about CVEs like this one. (PostgreSQL)
Is PostgreSQL on your server exposed to the internet?
The free port scanner finds the open ports on your server and matches the service versions it can read against known vulnerabilities. No account needed.
Run a port scanAffected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- debian debian linux12.0
- postgresql postgresql15.0 and later · before 15.4
- redhat enterprise linux8.0
- redhat enterprise linux9.0
Versions reported by the vendor
Affected version ranges reported by the assigning authority (redhat). Independent of NVD's CPE analysis and usually ahead of it.
Red Hat Red Hat Enterprise Linux 6
- all versionsunknown
Red Hat Red Hat Enterprise Linux 7
- all versionsunknown
Red Hat Red Hat Enterprise Linux 8
- 8090020231114113548.a75119d5 and laternot affected · rpm
- all versionsunknown
- all versionsunknown
- all versionsunknown
Red Hat Red Hat Enterprise Linux 8.8 Extended Update Support
- 8080020231113134015.63b34585 and laternot affected · rpm
Red Hat Red Hat Enterprise Linux 9
- 9030020231120082734.rhel9 and laternot affected · rpm
- all versionsunknown
Red Hat Red Hat Enterprise Linux 9.2 Extended Update Support
- 9020020231115020618.rhel9 and laternot affected · rpm
Red Hat Red Hat Software Collections
- all versionsunknown
- all versionsunknown
- all versionsunknown
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| AlmaLinux:8 | pg_repack | before 1.4.8-1.module_el8.8.0+3487+43ec1b9f | 1.4.8-1.module_el8.8.0+3487+43ec1b9f |
| AlmaLinux:8 | pgaudit | before 1.7.0-1.module_el8.8.0+3487+43ec1b9f | 1.7.0-1.module_el8.8.0+3487+43ec1b9f |
| AlmaLinux:8 | postgres-decoderbufs | before 1.9.7-1.Final.module_el8.8.0+3487+43ec1b9f | 1.9.7-1.Final.module_el8.8.0+3487+43ec1b9f |
| AlmaLinux:8 | postgresql | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-contrib | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-docs | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-plperl | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-plpython3 | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-pltcl | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-private-devel | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-private-libs | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-server | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-server-devel | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-static | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-test | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-test-rpm-macros | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-upgrade | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgresql-upgrade-devel | before 15.5-1.module_el8.9.0+3706+885c732e | 15.5-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:9 | pg_repack | before 1.4.8-1.module_el9.2.0+22+09653793 | 1.4.8-1.module_el9.2.0+22+09653793 |
| AlmaLinux:9 | pgaudit | before 1.7.0-1.module_el9.2.0+22+09653793 | 1.7.0-1.module_el9.2.0+22+09653793 |
| AlmaLinux:9 | postgres-decoderbufs | before 1.9.7-1.Final.module_el9.2.0+22+09653793 | 1.9.7-1.Final.module_el9.2.0+22+09653793 |
| AlmaLinux:9 | postgresql | before 15.5-1.module_el9.3.0+52+21733919 | 15.5-1.module_el9.3.0+52+21733919 |
| AlmaLinux:9 | postgresql-contrib | before 15.5-1.module_el9.3.0+52+21733919 | 15.5-1.module_el9.3.0+52+21733919 |
| AlmaLinux:9 | postgresql-docs | before 15.5-1.module_el9.3.0+52+21733919 | 15.5-1.module_el9.3.0+52+21733919 |
+96
Same product
postgresql: all recordsOther highest-scoring records for the same primary product.
- CVE-2017-7546PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allowing remote attackers57Plan
- CVE-2019-9193In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_server_program' group to 55Plan
- CVE-2020-25695A flaw was found in PostgreSQL versions before 13.1, before 12.5, before 11.10, before 10.15, before 9.6.20 and before 9.5.24.49Plan
Published before and after this one in the same product
- ← EarlierCVE-2023-2455Jun 9, 2023 · Row security policies disregard user ID changes after inlining; PostgreSQL could permit incorrect policies to be applied in certain cases wh21Monitor
- ← EarlierCVE-2023-39417Aug 11, 2023 · Postgresql: extension script @substitutions@ within quoting allow sql injection36Monitor
- Later →CVE-2020-21469Aug 22, 2023 · An issue was discovered in PostgreSQL 12.2 allows attackers to cause a denial of service via repeatedly sending SIGHUP signals.17Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| almalinux:pg_repack | 1.4.8-1.module_el9.2.0+22+09653793 · AlmaLinux:9 | Package registry (OSV) |
| almalinux:pgaudit | 1.7.0-1.module_el9.2.0+22+09653793 · AlmaLinux:9 | Package registry (OSV) |
| almalinux:postgres-decoderbufs | 1.9.7-1.Final.module_el9.2.0+22+09653793 · AlmaLinux:9 | Package registry (OSV) |
| almalinux:postgresql | 15.5-1.module_el9.3.0+52+21733919 · AlmaLinux:9 | Package registry (OSV) |
| almalinux:postgresql-contrib | 15.5-1.module_el9.3.0+52+21733919 · AlmaLinux:9 | Package registry (OSV) |
| almalinux:postgresql-docs | 15.5-1.module_el9.3.0+52+21733919 · AlmaLinux:9 | Package registry (OSV) |
| almalinux:postgresql-plperl | 15.5-1.module_el9.3.0+52+21733919 · AlmaLinux:9 | Package registry (OSV) |
| almalinux:postgresql-plpython3 | 15.5-1.module_el9.3.0+52+21733919 · AlmaLinux:9 | Package registry (OSV) |
| almalinux:postgresql-pltcl | 15.5-1.module_el9.3.0+52+21733919 · AlmaLinux:9 | Package registry (OSV) |
| almalinux:postgresql-private-devel | 15.5-1.module_el9.3.0+52+21733919 · AlmaLinux:9 | Package registry (OSV) |
| almalinux:postgresql-private-libs | 15.5-1.module_el9.3.0+52+21733919 · AlmaLinux:9 | Package registry (OSV) |
| almalinux:postgresql-server | 15.5-1.module_el9.3.0+52+21733919 · AlmaLinux:9 | Package registry (OSV) |
| alpine:postgresql | 13.12-r0 · Alpine:v3.13 | Package registry (OSV) |
| alpine:postgresql12 | 12.16-r0 · Alpine:v3.15 | Package registry (OSV) |
| alpine:postgresql13 | 13.12-r0 · Alpine:v3.15 | Package registry (OSV) |
| alpine:postgresql14 | 14.9-r0 · Alpine:v3.15 | Package registry (OSV) |
| alpine:postgresql15 | 15.4-r0 · Alpine:v3.17 | Package registry (OSV) |
| debian:postgresql-15 | 15.5-0+deb12u1 · Debian:12 | Package registry (OSV) |
| opensuse:postgresql15 | 15.4-150200.5.12.1 · openSUSE:Leap 15.4 | Package registry (OSV) |
| red hat:pg_repack | 0:1.4.8-1.module+el9.2.0+17405+aeb9ec60 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| red hat:pg_repack-debuginfo | 0:1.4.8-1.module+el9.2.0+17405+aeb9ec60 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| red hat:pg_repack-debugsource | 0:1.4.8-1.module+el9.2.0+17405+aeb9ec60 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| red hat:pgaudit | 0:1.7.0-1.module+el9.2.0+17405+aeb9ec60 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| red hat:pgaudit-debuginfo | 0:1.7.0-1.module+el9.2.0+17405+aeb9ec60 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| red hat:pgaudit-debugsource | 0:1.7.0-1.module+el9.2.0+17405+aeb9ec60 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| red hat:postgres-decoderbufs | 0:1.9.7-1.Final.module+el9.2.0+17405+aeb9ec60 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| red hat:postgres-decoderbufs-debuginfo | 0:1.9.7-1.Final.module+el9.2.0+17405+aeb9ec60 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| red hat:postgres-decoderbufs-debugsource | 0:1.9.7-1.Final.module+el9.2.0+17405+aeb9ec60 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| red hat:postgresql | 0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
| red hat:postgresql-contrib | 0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9 · Red Hat:enterprise_linux:9::appstream | Package registry (OSV) |
+6
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
No history yet (it accumulates with the daily EPSS job).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- A low-privileged account is enough.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- none
- Integrity
- low · data or configuration can be modified
- Availability
- none
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- Low
- Availability impact
- None
Weakness class (CWE)
CWE-1220 · Insufficient Granularity of Access ControlCVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
nvd-primary
Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (9 more)Show less
- access.redhat.com/errata/RHSA-2023:7883
- access.redhat.com/errata/RHSA-2023:7884
- access.redhat.com/errata/RHSA-2023:7885
- access.redhat.com/security/cve/CVE-2023-39418
- bugzilla.redhat.com/show_bug.cgi?id=2228112
- git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=cb2ae5741f2458a474ed3c31458d242e678ff229
- www.postgresql.org/support/security/CVE-2023-39418/
- security.netapp.com/advisory/ntap-20230915-0002/
- www.debian.org/security/2023/dsa-5553
Vendor advisories and official records. Exploit/PoC links are deliberately left out.