CWE-93Weakness · CWE-93

CVE-2025-8715

HIGH · 8.8 CVSS v3.1 Published 2025-08-14
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
95/100
Remediation priority · Urgent
Remotely reachable No privileges

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 · unedited
Improper 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 confidence

pg_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.

MitigationUpgrade 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.

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 checks

Work through these to decide whether this CVE applies to you.

  1. Check installed PostgreSQL version
    Run 'psql --version' or 'SELECT version();' to obtain the PostgreSQL major and minor version number
    Affected 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)
  2. Identify use of vulnerable tools
    Check 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 inspection
    Affected if Any of these tools are in use on a system with an affected PostgreSQL version
  3. Inspect for untrusted or restored dump files
    Review the filesystem for .dump, .sql, or backup files from untrusted sources in common directories such as /tmp, /var/backups, or application upload directories
    Affected if Dump files from untrusted sources exist and have been or could be restored
  4. Examine database object names for embedded newlines
    Query 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.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade 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.

Recommended fix High confidence

PostgreSQL 17.6 (or 16.10/15.14/14.19/13.22 depending on your major version)

  1. 1. Identify current PostgreSQL version: psql --version or SELECT version();
  2. 2. Plan upgrade to one of the fixed versions: PostgreSQL 17.6, 16.10, 15.14, 14.19, or 13.22
  3. 3. Perform full backup of all databases before upgrading
  4. 4. Upgrade PostgreSQL to the appropriate fixed version using your system's package manager or from source
  5. 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. 6. Ensure dump files are validated before restore to prevent restore-time code execution
Caveat Upgrading PostgreSQL major versions may require migration steps and can have compatibility changes; review release notes before upgrading

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing12.0 h
  • Review / QA4.0 h
28.0 hours of engineering $4,760
Get help mitigating

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 locally
dbcve dependency scanner

Check 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2025-8715 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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