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.
- 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
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
Which versions are affected by CVE-2025-8714?
1 open source package ship an affected version, including postgresql.
| Package | Affected | Fixed in |
|---|---|---|
postgresql Bitnami | All versions | 13.22.0, 14.19.0, 15.14.0, 16.10.0, 17.6.0 |
Linux distribution packages (14)
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.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
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: 1 proofs of concept on GitHub.
Sources
Also known as ALPINE-CVE-2025-8714, AZL-66303, AZL-66324, BELL-CVE-2025-8714, BIT-postgresql-2025-8714, CLEANSTART-2026-HH85591 and 12 more.