CVE-2024-7348
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedTime-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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceTOCTOU race condition in pg_dump where an attacker who creates an object can win the race to replace it with a view or foreign table after pg_dump checks the object type but before dumping it, allowing execution of arbitrary SQL functions as the pg_dump user (often a superuser). The attack is trivial if the attacker maintains an open transaction.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data>= 12.0, < 12.20>= 13.0, < 13.16>= 14.0, < 14.13>= 15.0, < 15.8>= 16.0, < 16.4CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- High
- Privileges
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify installed PostgreSQL versionRun 'psql --version' or 'SELECT version();' to get the exact PostgreSQL version numberAffected if The version falls within these ranges: 12.0-12.19, 13.0-13.15, 14.0-14.12, 15.0-15.7, or 16.0-16.3
-
Check for untrusted database usersQuery 'SELECT rolname FROM pg_roles WHERE rolsuper = false;' to list non-superuser roles, then review which roles have CREATE permission on databases or schemas via 'SELECT grantee, privilege_type FROM information_schema.usage_privileges WHERE privilege_type = 'USAGE';'Affected if There are non-superuser roles with CREATE privileges that an attacker could control to exploit the race condition during pg_dump operations
-
Determine if pg_dump is in useCheck for scheduled or active pg_dump processes: 'ps aux | grep pg_dump' on Linux or check SQL Server Agent/Windows Task Scheduler for database backup jobs that use pg_dumpAffected if pg_dump or any tool using libpq to dump objects is being executed against a database where untrusted users can create objects
You are affected if your PostgreSQL version is in the affected range AND you have non-superuser roles with CREATE permissions that could race against pg_dump operations.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped12.2013.1614.13
Upgrade PostgreSQL to version 16.4, 15.8, 14.13, 13.16, 12.20 or later to patch the race condition in pg_dump.
PostgreSQL 12.20, 13.16, 14.13, 15.8, or 16.4+ (choose the appropriate version for your major version line)
- 1. Identify the current PostgreSQL version by running: psql --version or SELECT version();
- 2. Determine which major version line you are running (12.x, 13.x, 14.x, or 15.x)
- 3. For PostgreSQL 12.x: Upgrade to version 12.20 or later
- 4. For PostgreSQL 13.x: Upgrade to version 13.16 or later
- 5. For PostgreSQL 14.x: Upgrade to version 14.13 or later
- 6. For PostgreSQL 15.x: Upgrade to version 15.8 or later
- 7. Alternatively, upgrade to PostgreSQL 16.4 or later to get all fixes
- 8. Before upgrading in production, backup all databases: pg_dumpall > backup.sql
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation6.0 h
- Implementation8.0 h
- Testing6.0 h
- Review / QA4.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $6,816.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2024-7348 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2024-7348 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data