PostgreSQL relation replacement during pg_dump executes arbitrary SQL
Noroxi assessment
Priority: Monitor (action score 30/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.5% (FIRST EPSS); higher than 74.6% 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. Special conditions such as timing or configuration are required.
- Fixed version: n/a PostgreSQL 12.20, 13.16, 14.13.
Low priority for now. Upgrade to n/a PostgreSQL 12.20, 13.16, 14.13 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
Time-of-check Time-of-use (TOCTOU) race condition in pg_dump in PostgreSQL allows an object creator to execute arbitrary SQL functions as the user running pg_dump, which is often a superuser. The attack involves replacing another relation type with a view or foreign table. The attack requires waiting for pg_dump to start, but winning the race condition is trivial if the attacker retains an open transaction. Versions before PostgreSQL 16.4, 15.8, 14.13, 13.16, and 12.20 are affected.
- BDU:2024-06153
- ALSA-2024:5927
- ALSA-2024:5929
- ALSA-2024:5999
- ALSA-2024:6000
- ALSA-2024:6001
- ALSA-2024:6018
- ALSA-2024:6020
- DSA-5745-1
- DSA-5746-1
- openSUSE-SU-2024:14348-1
- openSUSE-SU-2024:14349-1
- openSUSE-SU-2024:14350-1
- openSUSE-SU-2024:14351-1
- openSUSE-SU-2024:14360-1
- openSUSE-SU-2024:14361-1
- RHSA-2024:5927
- RHSA-2024:5929
- RHSA-2024:5999
- RHSA-2024:6000
- Published
- Aug 8, 2024
- Updated
- Jun 17, 2026
- EPSS
- 1.6% · 75th percentile
- CWE
- CWE-367
Report tools
Action score
30
Monitor
Low priority for now.
- CVSS
- 30 / 40 · 7.5 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 1.6%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- 7.5
- CNA · PostgreSQL
- 8.8
- 1.3 point gap
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
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 |
Using postgresql? Add it to your stack and be the first to know about CVEs like this one. (PostgreSQL)
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- postgresql postgresql12.0 and later · before 12.20
- postgresql postgresql13.0 and later · before 13.16
- postgresql postgresql14.0 and later · before 14.13
- postgresql postgresql15.0 and later · before 15.8
- postgresql postgresql16.0 and later · before 16.4
Versions reported by the vendor
Affected version ranges reported by the assigning authority (PostgreSQL). Independent of NVD's CPE analysis and usually ahead of it.
n/a PostgreSQL
- 16 and later · before 16.4affected · rpm
- 15 and later · before 15.8affected · rpm
- 14 and later · before 14.13affected · rpm
- 13 and later · before 13.16affected · rpm
- before 12.20affected · rpm
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.9.0+3706+885c732e | 1.4.8-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | pg_repack | before 1.4.6-3.module_el8.6.0+2760+1746ec94 | 1.4.6-3.module_el8.6.0+2760+1746ec94 |
| AlmaLinux:8 | pg_repack | before 1.4.6-3.module_el8.6.0+3095+ee60d910 | 1.4.6-3.module_el8.6.0+3095+ee60d910 |
| AlmaLinux:8 | pg_repack | before 1.4.6-3.module_el8.9.0+3704+f1f917ce | 1.4.6-3.module_el8.9.0+3704+f1f917ce |
| AlmaLinux:8 | pg_repack | before 1.4.8-1.module_el8.10.0+3798+606ebb9f | 1.4.8-1.module_el8.10.0+3798+606ebb9f |
| AlmaLinux:8 | pgaudit | before 1.5.0-1.module_el8.6.0+2760+1746ec94 | 1.5.0-1.module_el8.6.0+2760+1746ec94 |
| AlmaLinux:8 | pgaudit | before 1.4.0-7.module_el8.9.0+3740+0e74851f.alma.1 | 1.4.0-7.module_el8.9.0+3740+0e74851f.alma.1 |
| AlmaLinux:8 | pgaudit | before 1.7.0-1.module_el8.9.0+3706+885c732e | 1.7.0-1.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | pgaudit | before 16.0-1.module_el8.10.0+3798+606ebb9f | 16.0-1.module_el8.10.0+3798+606ebb9f |
| AlmaLinux:8 | pgaudit | before 1.5.0-1.module_el8.6.0+3095+ee60d910 | 1.5.0-1.module_el8.6.0+3095+ee60d910 |
| AlmaLinux:8 | postgres-decoderbufs | before 2.4.0-1.Final.module_el8.10.0+3798+606ebb9f | 2.4.0-1.Final.module_el8.10.0+3798+606ebb9f |
| AlmaLinux:8 | postgres-decoderbufs | before 0.10.0-2.module_el8.9.0+3704+f1f917ce | 0.10.0-2.module_el8.9.0+3704+f1f917ce |
| AlmaLinux:8 | postgres-decoderbufs | before 0.10.0-2.module_el8.6.0+3095+ee60d910 | 0.10.0-2.module_el8.6.0+3095+ee60d910 |
| AlmaLinux:8 | postgres-decoderbufs | before 1.9.7-1.Final.module_el8.9.0+3706+885c732e | 1.9.7-1.Final.module_el8.9.0+3706+885c732e |
| AlmaLinux:8 | postgres-decoderbufs | before 0.10.0-2.module_el8.6.0+2760+1746ec94 | 0.10.0-2.module_el8.6.0+2760+1746ec94 |
| AlmaLinux:8 | postgresql | before 13.16-1.module_el8.10.0+3887+93e5d125 | 13.16-1.module_el8.10.0+3887+93e5d125 |
| AlmaLinux:8 | postgresql | before 16.4-1.module_el8.10.0+3884+a79fbae6 | 16.4-1.module_el8.10.0+3884+a79fbae6 |
| AlmaLinux:8 | postgresql | before 15.8-1.module_el8.10.0+3888+1aead837 | 15.8-1.module_el8.10.0+3888+1aead837 |
| AlmaLinux:8 | postgresql | before 12.20-1.module_el8.10.0+3886+1dfe41d7 | 12.20-1.module_el8.10.0+3886+1dfe41d7 |
| AlmaLinux:8 | postgresql-contrib | before 15.8-1.module_el8.10.0+3888+1aead837 | 15.8-1.module_el8.10.0+3888+1aead837 |
| AlmaLinux:8 | postgresql-contrib | before 12.20-1.module_el8.10.0+3886+1dfe41d7 | 12.20-1.module_el8.10.0+3886+1dfe41d7 |
| AlmaLinux:8 | postgresql-contrib | before 13.16-1.module_el8.10.0+3887+93e5d125 | 13.16-1.module_el8.10.0+3887+93e5d125 |
| AlmaLinux:8 | postgresql-contrib | before 16.4-1.module_el8.10.0+3884+a79fbae6 | 16.4-1.module_el8.10.0+3884+a79fbae6 |
| AlmaLinux:8 | postgresql-docs | before 15.8-1.module_el8.10.0+3888+1aead837 | 15.8-1.module_el8.10.0+3888+1aead837 |
+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
- CVE-2007-3280The Database Link library (dblink) in PostgreSQL 8.1 implements functions via CREATE statements that map to arbitrary libraries based on the44Plan
- CVE-2013-1899Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows remote attackers to ca42Plan
- CVE-2018-16850postgresql before versions 11.1, 10.6 is vulnerable to a to SQL injection in pg_upgrade and pg_dump via CREATE TRIGGER ...41Plan
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 |
|---|---|---|
| n/a PostgreSQL | 12.20 | Vendor (CNA) |
| n/a PostgreSQL | 13.16 | Vendor (CNA) |
| n/a PostgreSQL | 14.13 | Vendor (CNA) |
| n/a PostgreSQL | 15.8 | Vendor (CNA) |
| n/a PostgreSQL | 16.4 | Vendor (CNA) |
| almalinux:pg_repack | 1.4.8-1.module_el8.10.0+3798+606ebb9f · AlmaLinux:8 | Package registry (OSV) |
| almalinux:pgaudit | 16.0-1.module_el8.10.0+3798+606ebb9f · AlmaLinux:8 | Package registry (OSV) |
| almalinux:postgres-decoderbufs | 2.4.0-1.Final.module_el8.10.0+3798+606ebb9f · AlmaLinux:8 | Package registry (OSV) |
| almalinux:postgresql | 16.4-1.module_el8.10.0+3884+a79fbae6 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:postgresql-contrib | 16.4-1.module_el8.10.0+3884+a79fbae6 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:postgresql-docs | 16.4-1.module_el8.10.0+3884+a79fbae6 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:postgresql-plperl | 16.4-1.module_el8.10.0+3884+a79fbae6 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:postgresql-plpython3 | 16.4-1.module_el8.10.0+3884+a79fbae6 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:postgresql-pltcl | 16.4-1.module_el8.10.0+3884+a79fbae6 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:postgresql-private-devel | 16.4-1.module_el8.10.0+3884+a79fbae6 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:postgresql-private-libs | 16.4-1.module_el8.10.0+3884+a79fbae6 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:postgresql-server | 16.4-1.module_el8.10.0+3884+a79fbae6 · AlmaLinux:8 | Package registry (OSV) |
| alpine:postgresql14 | 14.13-r0 · Alpine:v3.17 | Package registry (OSV) |
| alpine:postgresql15 | 15.8-r0 · Alpine:v3.17 | Package registry (OSV) |
| alpine:postgresql16 | 16.4-r0 · Alpine:v3.19 | Package registry (OSV) |
| debian:postgresql-13 | 13.16-0+deb11u1 · Debian:11 | Package registry (OSV) |
| debian:postgresql-15 | 15.8-0+deb12u1 · Debian:12 | Package registry (OSV) |
| opensuse:postgresql12 | 12.20-150200.8.63.1 · openSUSE:Leap 15.5 | Package registry (OSV) |
| opensuse:postgresql13 | 13.16-150200.5.61.1 · openSUSE:Leap 15.5 | Package registry (OSV) |
| opensuse:postgresql14 | 14.13-150600.16.6.1 · openSUSE:Leap 15.6 | Package registry (OSV) |
| opensuse:postgresql15 | 15.8-150600.16.6.1 · openSUSE:Leap 15.6 | Package registry (OSV) |
| opensuse:postgresql16 | 16.4-150600.16.5.1 · openSUSE:Leap 15.6 | Package registry (OSV) |
| opensuse:postgresql16-mini | 16.4-150200.5.16.1 · openSUSE:Leap 15.5 | Package registry (OSV) |
| opensuse:postgresql17 | 17~rc1-1.1 · openSUSE:Tumbleweed | Package registry (OSV) |
| red hat:pg_repack | 0:1.4.8-1.module+el8.10.0+20413+d8116364 · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
+21
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.
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
No commit or PR link among the references.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
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.
- Special conditions such as timing or configuration are required.
If successful
- Confidentiality
- high · data can be read
- Integrity
- high · data or configuration can be modified
- Availability
- high · the service can be disrupted
- Attack vector
- Network
- Attack complexity
- High
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- High
- Integrity impact
- High
- Availability impact
- High
Weakness class (CWE)
CWE-367 · Time-of-check Time-of-use (TOCTOU) Race ConditionCVSS vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
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 (2 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.