Cloudanix VulnDB

CVE-2025-8714

High · 8.8

CVSS

8.8

EPSS

0.8%

Published

Aug 14, 2025

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A flaw in PostgreSQL backup tools lets attackers who control a source database run harmful commands on the computer used to restore a backup from that database.

Exploitation
Requires User Interaction
Attacker needs
High Privilege
Complexity
Moderate
Impact
Remote Code Execution
Component
Application
Class
Command Injection
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Allows a malicious database superuser to embed arbitrary operating system commands within a database dump that execute with the privileges of the user restoring the dump using psql or pg_restore in plain format.

Why it matters to the business

Attackers can achieve remote code execution on systems restoring PostgreSQL dumps, potentially leading to full system compromise, data theft, or further lateral movement if superuser access on the source is obtained; high downstream package prevalence increases exposure across Linux distributions.

How an attack unfolds

An attacker with superuser privileges on a PostgreSQL server crafts a malicious dump using pg_dump that includes injected meta-commands. When a victim uses psql to restore this dump, the commands execute on the victim's machine as the client operating system account.

How to fix it

Upgrade PostgreSQL to versions 17.6, 16.10, 15.14, 14.19, or 13.22 or later. For affected linux-lts packages update to 6.1.147-r0 on Alpaquita 23 and 6.12.41-r0 on Alpaquita stream and 25.

How to confirm the fix worked

Verify the installed PostgreSQL version meets or exceeds the fixed releases listed for each distribution. Perform controlled dump and restore tests using isolated environments to confirm absence of injection behavior.

Typical attack path

  1. Obtain superuser access on the origin PostgreSQL server
  2. Create or modify database objects to trigger command injection in pg_dump output
  3. Generate and distribute the malicious dump file to the target environment
  4. Victim executes psql or pg_restore against the dump, triggering execution of attacker-controlled commands

How to detect it

Inspect psql and pg_restore process logs for unexpected meta-command execution or shell activity during restore operations; correlate with source database superuser activity if logs are available.

What your security team should do

  • Apply the listed fixed package versions immediately across all affected linux-lts deployments
  • Limit superuser privileges on source database servers and enforce least-privilege restore accounts
  • Isolate restore operations and require integrity verification of dump files before use
  • Update incident response playbooks to include PostgreSQL dump analysis for injected meta-commands

The record

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.

Affected packages

Ecosystem Package Introduced Fixed
AlmaLinux:10 postgresql 0 16.10-1.el10_0
AlmaLinux:10 postgresql-contrib 0 16.10-1.el10_0
AlmaLinux:10 postgresql-docs 0 16.10-1.el10_0
AlmaLinux:10 postgresql-plperl 0 16.10-1.el10_0
AlmaLinux:10 postgresql-plpython3 0 16.10-1.el10_0
AlmaLinux:10 postgresql-pltcl 0 16.10-1.el10_0
AlmaLinux:10 postgresql-private-devel 0 16.10-1.el10_0
AlmaLinux:10 postgresql-private-libs 0 16.10-1.el10_0
AlmaLinux:10 postgresql-server 0 16.10-1.el10_0
AlmaLinux:10 postgresql-server-devel 0 16.10-1.el10_0
AlmaLinux:10 postgresql-static 0 16.10-1.el10_0
AlmaLinux:10 postgresql-test 0 16.10-1.el10_0
AlmaLinux:10 postgresql-test-rpm-macros 0 16.10-1.el10_0
AlmaLinux:10 postgresql-upgrade 0 16.10-1.el10_0
AlmaLinux:10 postgresql-upgrade-devel 0 16.10-1.el10_0
AlmaLinux:8 pg_repack 0 1.5.1-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 pg_repack 0 1.4.6-3.module_el8.6.0+2760+1746ec94
AlmaLinux:8 pg_repack 0 1.4.6-3.module_el8.6.0+3095+ee60d910
AlmaLinux:8 pg_repack 0 1.4.8-1.module_el8.9.0+3706+885c732e
AlmaLinux:8 pg_repack 0 1.4.6-3.module_el8.9.0+3704+f1f917ce
AlmaLinux:8 pgaudit 0 16.0-1.module_el8.10.0+3798+606ebb9f
AlmaLinux:8 pgaudit 0 1.5.0-1.module_el8.6.0+2760+1746ec94
AlmaLinux:8 pgaudit 0 1.5.0-1.module_el8.6.0+3095+ee60d910
AlmaLinux:8 pgaudit 0 1.7.0-1.module_el8.9.0+3706+885c732e
AlmaLinux:8 pgaudit 0 1.4.0-7.module_el8.10.0+3889+48cb11fb.alma.1
AlmaLinux:8 pgaudit 0 1.4.0-7.module_el8.9.0+3740+0e74851f.alma.1
AlmaLinux:8 postgres-decoderbufs 0 2.4.0-1.Final.module_el8.10.0+3798+606ebb9f
AlmaLinux:8 postgres-decoderbufs 0 0.10.0-2.module_el8.6.0+2760+1746ec94
AlmaLinux:8 postgres-decoderbufs 0 0.10.0-2.module_el8.6.0+3095+ee60d910
AlmaLinux:8 postgres-decoderbufs 0 1.9.7-1.Final.module_el8.9.0+3706+885c732e
AlmaLinux:8 postgres-decoderbufs 0 0.10.0-2.module_el8.9.0+3704+f1f917ce
AlmaLinux:8 postgresql 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:8 postgresql-contrib 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-contrib 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql-contrib 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-contrib 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:8 postgresql-docs 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-docs 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql-docs 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-docs 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:8 postgresql-plperl 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-plperl 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql-plperl 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-plperl 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:8 postgresql-plpython3 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-plpython3 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql-plpython3 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-plpython3 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:8 postgresql-pltcl 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-pltcl 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql-pltcl 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-pltcl 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:8 postgresql-private-devel 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-private-devel 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-private-libs 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-private-libs 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-server 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-server 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql-server 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-server 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:8 postgresql-server-devel 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-server-devel 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql-server-devel 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-server-devel 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:8 postgresql-static 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-static 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql-static 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-static 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:8 postgresql-test 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-test 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql-test 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-test 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:8 postgresql-test-rpm-macros 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-test-rpm-macros 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql-test-rpm-macros 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-test-rpm-macros 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:8 postgresql-upgrade 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-upgrade 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql-upgrade 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-upgrade 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:8 postgresql-upgrade-devel 0 16.10-1.module_el8.10.0+4038+0fbad93c
AlmaLinux:8 postgresql-upgrade-devel 0 13.22-1.module_el8.10.0+4042+cb252986
AlmaLinux:8 postgresql-upgrade-devel 0 15.14-1.module_el8.10.0+4041+afd30bb4
AlmaLinux:8 postgresql-upgrade-devel 0 12.22-5.module_el8.10.0+4043+6cac3079
AlmaLinux:9 pg_repack 0 1.5.1-1.module_el9.6.0+146+c54fdeca
AlmaLinux:9 pg_repack 0 1.4.8-2.module_el9.5.0+119+18833d03
AlmaLinux:9 pgaudit 0 16.0-1.module_el9.4.0+66+eb9878bc
AlmaLinux:9 pgaudit 0 1.7.0-1.module_el9.3.0+52+21733919
AlmaLinux:9 pgvector 0 0.6.2-2.module_el9.6.0+167+4e561146
AlmaLinux:9 postgres-decoderbufs 0 2.4.0-1.Final.module_el9.4.0+66+eb9878bc
AlmaLinux:9 postgres-decoderbufs 0 1.9.7-1.Final.module_el9.3.0+52+21733919
AlmaLinux:9 postgresql 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql 0 13.22-1.el9_6
AlmaLinux:9 postgresql-contrib 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-contrib 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-contrib 0 13.22-1.el9_6
AlmaLinux:9 postgresql-docs 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-docs 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-docs 0 13.22-1.el9_6
AlmaLinux:9 postgresql-plperl 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-plperl 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-plperl 0 13.22-1.el9_6
AlmaLinux:9 postgresql-plpython3 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-plpython3 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-plpython3 0 13.22-1.el9_6
AlmaLinux:9 postgresql-pltcl 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-pltcl 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-pltcl 0 13.22-1.el9_6
AlmaLinux:9 postgresql-private-devel 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-private-devel 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-private-devel 0 13.22-1.el9_6
AlmaLinux:9 postgresql-private-libs 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-private-libs 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-private-libs 0 13.22-1.el9_6
AlmaLinux:9 postgresql-server 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-server 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-server 0 13.22-1.el9_6
AlmaLinux:9 postgresql-server-devel 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-server-devel 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-server-devel 0 13.22-1.el9_6
AlmaLinux:9 postgresql-static 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-static 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-static 0 13.22-1.el9_6
AlmaLinux:9 postgresql-test 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-test 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-test 0 13.22-1.el9_6
AlmaLinux:9 postgresql-test-rpm-macros 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-test-rpm-macros 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-test-rpm-macros 0 13.22-1.el9_6
AlmaLinux:9 postgresql-upgrade 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-upgrade 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-upgrade 0 13.22-1.el9_6
AlmaLinux:9 postgresql-upgrade-devel 0 16.10-1.module_el9.6.0+174+80cb77f0
AlmaLinux:9 postgresql-upgrade-devel 0 15.14-1.module_el9.6.0+176+c508cfa2
AlmaLinux:9 postgresql-upgrade-devel 0 13.22-1.el9_6
Alpine:v3.19 postgresql15 0 15.14-r0
Alpine:v3.19 postgresql16 0 16.10-r0
Alpine:v3.20 postgresql15 0 15.14-r0
Alpine:v3.20 postgresql16 0 16.10-r0
Alpine:v3.21 postgresql16 0 16.10-r0
Alpine:v3.21 postgresql17 0 17.6-r0
Alpine:v3.22 postgresql16 0 16.10-r0
Alpine:v3.22 postgresql17 0 17.6-r0
Bitnami postgresql 0 13.22.0
Debian:11 postgresql-13 0 13.22-0+deb11u1
Debian:12 postgresql-15 0 No fix
Debian:13 postgresql-17 0 No fix
Debian:14 postgresql-17 0 No fix
Mageia:9 postgresql13 0 13.22-1.mga9
Mageia:9 postgresql15 0 15.14-1.mga9
SUSE:Linux Enterprise Module for Basesystem 15 SP6 postgresql16 0 16.10-150600.16.21.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 postgresql17 0 17.6-150600.13.16.1
SUSE:Linux Enterprise Module for Basesystem 15 SP7 postgresql17 0 17.6-150600.13.16.1
SUSE:Linux Enterprise Module for Legacy 15 SP6 postgresql14 0 14.19-150600.16.20.1
SUSE:Linux Enterprise Module for Legacy 15 SP6 postgresql15 0 15.14-150600.16.20.1
SUSE:Linux Enterprise Module for Legacy 15 SP7 postgresql14 0 14.19-150600.16.20.1
SUSE:Linux Enterprise Module for Legacy 15 SP7 postgresql15 0 15.14-150600.16.20.1
SUSE:Linux Enterprise Module for Legacy 15 SP7 postgresql16 0 16.10-150600.16.21.1
SUSE:Linux Enterprise Module for Package Hub 15 SP6 postgresql14 0 14.19-150600.16.20.1
SUSE:Linux Enterprise Module for Package Hub 15 SP6 postgresql16 0 16.10-150600.16.21.1
SUSE:Linux Enterprise Module for Package Hub 15 SP6 postgresql17 0 17.6-150600.13.16.1
SUSE:Linux Enterprise Module for Package Hub 15 SP7 postgresql14 0 14.19-150600.16.20.1
SUSE:Linux Enterprise Module for Package Hub 15 SP7 postgresql16 0 16.10-150600.16.21.1
SUSE:Linux Enterprise Module for Package Hub 15 SP7 postgresql17 0 17.6-150600.13.16.1
SUSE:Linux Enterprise Module for Server Applications 15 SP6 postgresql16 0 16.10-150600.16.21.1
SUSE:Linux Enterprise Module for Server Applications 15 SP6 postgresql17 0 17.6-150600.13.16.1
SUSE:Linux Enterprise Module for Server Applications 15 SP7 postgresql16 0 16.10-150600.16.21.1
SUSE:Linux Enterprise Module for Server Applications 15 SP7 postgresql17 0 17.6-150600.13.16.1
SUSE:Linux Enterprise Server 12 SP5-LTSS postgresql14 0 14.19-3.60.1
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 postgresql14 0 14.19-3.60.1
openSUSE:Leap 15.6 postgresql13 0 13.22-150600.14.11.1
openSUSE:Leap 15.6 postgresql14 0 14.19-150600.16.20.1
openSUSE:Leap 15.6 postgresql15 0 15.14-150600.16.20.1
openSUSE:Leap 15.6 postgresql16 0 16.10-150600.16.21.1
openSUSE:Leap 15.6 postgresql17 0 17.6-150600.13.16.1
openSUSE:Tumbleweed matrix-synapse 0 1.137.0-1.1
openSUSE:Tumbleweed postgresql13 0 13.22-1.1
openSUSE:Tumbleweed postgresql14 0 14.19-1.1
openSUSE:Tumbleweed postgresql15 0 15.14-1.1
openSUSE:Tumbleweed postgresql16 0 16.10-1.1
openSUSE:Tumbleweed postgresql17 0 17.6-1.1

Related vulnerabilities