CVE-2025-8715
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 · uneditedImproper neutralization of newlines in pg_dump in PostgreSQL allows a user of the origin server to inject arbitrary code for restore-time execution as the client operating system account running psql to restore the dump, via psql meta-commands inside a purpose-crafted object name. The same attacks can achieve SQL injection as a superuser of the restore target server. pg_dumpall, pg_restore, and pg_upgrade are also affected. Versions before PostgreSQL 17.6, 16.10, 15.14, 14.19, and 13.22 are affected. Versions before 11.20 are unaffected. CVE-2012-0868 had fixed this class of problem, but version 11.20 reintroduced it.
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 confidencepg_dump in PostgreSQL fails to properly neutralize newlines in object names, allowing injection of psql meta-commands that execute arbitrary code when a dump is restored. This enables code execution as the OS account running psql and SQL injection as a superuser on the restore target. The same vulnerability exists in pg_dumpall, pg_restore, and pg_upgrade. This is a regression from CVE-2012-0868 reintroduced in version 11.20.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS 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
- Low
- Privileges
- None
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/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.
-
Check installed PostgreSQL versionRun 'psql --version' or 'SELECT version();' to obtain the PostgreSQL major and minor version numberAffected if Version is 11.20 through 13.21, 14.0 through 14.18, 15.0 through 15.13, 16.0 through 16.9, or 17.0 through 17.5 (i.e., below the fixed versions 13.22, 14.19, 15.14, 16.10, 17.6)
-
Identify use of vulnerable toolsCheck if pg_dump, pg_dumpall, pg_restore, or pg_upgrade binaries exist on the system and are in use via 'which pg_dump pg_dumpall pg_restore pg_upgrade' or process inspectionAffected if Any of these tools are in use on a system with an affected PostgreSQL version
-
Inspect for untrusted or restored dump filesReview the filesystem for .dump, .sql, or backup files from untrusted sources in common directories such as /tmp, /var/backups, or application upload directoriesAffected if Dump files from untrusted sources exist and have been or could be restored
-
Examine database object names for embedded newlinesQuery the system catalog: SELECT typname FROM pg_type WHERE typname LIKE E'% %' UNION ALL SELECT relname FROM pg_class WHERE relname LIKE E'% %' UNION ALL SELECT proname FROM pg_proc WHERE proname LIKE E'% %';Affected if Any objects returned contain literal newline characters in their names
The environment is likely affected if the installed PostgreSQL version falls below the fixed releases (13.22, 14.19, 15.14, 16.10, 17.6) and pg_dump-based tools are used to restore dumps, particularly from untrusted sources.
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 · scopedUpgrade PostgreSQL to versions 17.6, 16.10, 15.14, 14.19, or 13.22 or later to apply the patch. Validate and audit dumps from untrusted sources before restoration.
PostgreSQL 17.6 (or 16.10/15.14/14.19/13.22 depending on your major version)
- 1. Identify current PostgreSQL version: psql --version or SELECT version();
- 2. Plan upgrade to one of the fixed versions: PostgreSQL 17.6, 16.10, 15.14, 14.19, or 13.22
- 3. Perform full backup of all databases before upgrading
- 4. Upgrade PostgreSQL to the appropriate fixed version using your system's package manager or from source
- 5. After upgrade, restore dumps using pg_dump/pg_restore as usual - the vulnerability is in the dump creation, not restore, so existing dumps from vulnerable versions should be reviewed
- 6. Ensure dump files are validated before restore to prevent restore-time code execution
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation4.0 h
- Implementation8.0 h
- Testing12.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 $7,616.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2025-8715 — 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-2025-8715 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