# CVE-2025-8714: PostgreSQL pg_dump lets superuser of origin server execute arbitrary code in psql client

> A malicious superuser on the origin server can inject arbitrary code into pg_dump output, leading to code execution on the client machine during restore.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 14 Aug 2025
- **Updated:** 26 Feb 2026
- **Also known as:** ALPINE-CVE-2025-8714, AZL-66303, AZL-66324, BELL-CVE-2025-8714, BIT-postgresql-2025-8714, CLEANSTART-2026-HH85591, CLSA-2025-1764773940, DEBIAN-CVE-2025-8714, ECHO-fd55-a447-698b, GHSA-6m5q-cc57-2mj6, MINI-6c5p-vjm9-63x4, MINI-8fqq-p2ww-653v, MINI-h647-j78g-fwpw, MINI-mg4q-8wg5-gv88, MINI-r2q8-j8hm-23jp, RHSA-2025:16099, UBUNTU-CVE-2025-8714, openSUSE-SU-2025:15493-1

## What is CVE-2025-8714?

CVE-2025-8714 is a high-severity code injection vulnerability in PostgreSQL, published on 14 Aug 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Untrusted data inclusion in pg_dump in PostgreSQL allows a malicious superuser 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.  pg_dumpall is also affected.  pg_restore is affected when used to generate a plain-format dump.  This is similar to MySQL CVE-2024-21096.  Versions before PostgreSQL 17.6, 16.10, 15.14, 14.19, and 13.22 are affected.

Weakness: CWE-829 (Inclusion of Functionality from Untrusted Control Sphere)

## Which versions are affected by CVE-2025-8714?

1 open source package ship an affected version, including postgresql.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `postgresql` | Bitnami | All versions | 13.22.0, 14.19.0, 15.14.0, 16.10.0, 17.6.0 |
| `postgresql` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `postgresql-contrib` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `postgresql-debuginfo` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `postgresql-devel` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `postgresql-docs` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `postgresql-libs` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `postgresql-plperl` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `postgresql-plpython` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `postgresql-pltcl` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `postgresql-server` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `postgresql-static` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `postgresql-test` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `postgresql-upgrade` | Red Hat:rhel_els:7 | All versions | 0:9.2.24-9.el7_9.4 |
| `matrix-synapse` | openSUSE:Tumbleweed | All versions | 1.137.0-1.1 |

## How do I fix CVE-2025-8714?

Upgrade postgresql to a fixed version for your release line: 13.22.0, 14.19.0, 15.14.0 or 16.10.0.

## Is CVE-2025-8714 being exploited?

There is no known exploitation of CVE-2025-8714 in the wild and no public exploit code.

Public exploit code:

- PoC de RCE en PostgreSQL — CVE-2025-8714 (github_poc): https://github.com/orderby99/CVE-2025-8714-POC

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-8714 and fix it if it is affected.

What it is: CVE-2025-8714 is a high-severity code injection vulnerability in PostgreSQL, published on 14 Aug 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2025-8714 in the wild and no public exploit code.

Affected packages and fixed versions:
- postgresql (Bitnami): affected all versions; fixed in 13.22.0, 14.19.0, 15.14.0, 16.10.0, 17.6.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-8714/ (Markdown: https://insights.sbomify.com/CVE-2025-8714/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-8714
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-8714
- OSV: https://osv.dev/vulnerability/CVE-2025-8714

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-8714/
Summaries are generated and may contain mistakes; the official description above is the record.
