CVEfocus › CVE database › CVE-2025-8715

CVE-2025-8715PostgreSQL pg_dump newline in object name executes arbitrary code in psql client and in…

CVSS 8.8 HighEPSS 0.8% (higher than 54% of CVEs)Published 2025-08-14Updated 2026-02-26Assigner: PostgreSQL

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.

CWE-93

What to do

Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

119Fixed
4Fix pending
10Will not fix
12Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 25.10postgresql-17Fixed17.6-1UBUNTU-CVE-2025-8715
Ubuntu 24.04postgresql-16Fixed16.10-0ubuntu0.24.04.1UBUNTU-CVE-2025-8715
Ubuntu 22.04postgresql-14Fixed14.19-0ubuntu0.22.04.1UBUNTU-CVE-2025-8715
Ubuntu 20.04postgresql-12Fix pendingUBUNTU-CVE-2025-8715
Ubuntu 18.04postgresql-10Fix pendingUBUNTU-CVE-2025-8715
Ubuntu 16.04postgresql-9.5Fix pendingUBUNTU-CVE-2025-8715
Ubuntu 14.04postgresql-9.3Fix pendingUBUNTU-CVE-2025-8715
Debian 13postgresql-17Fixed17.6-0+deb13u1DEBIAN-CVE-2025-8715
Debian 12postgresql-15Fixed15.14-0+deb12u1DEBIAN-CVE-2025-8715
Red Hat Enterprise Linux 10postgresqlFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-contribFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-docsFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-plperlFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-plpython3Fixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-pltclFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-private-develFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-private-libsFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-serverFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-server-develFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-staticFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-testFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-test-rpm-macrosFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-upgradeFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql-upgrade-develFixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 10postgresql16Fixed0:16.10-1.el10_0RHSA-2025:14826
Red Hat Enterprise Linux 9pg_repackFixed0:1.4.8-2.module+el9.5.0+22224+f5585c78RHSA-2025:14827
Red Hat Enterprise Linux 9pgauditFixed0:16.0-1.module+el9.4.0+20427+07482b8cRHSA-2025:14862
Red Hat Enterprise Linux 9pgvectorFixed0:0.6.2-2.module+el9.6.0+22979+c3d78d52RHSA-2025:14827
Red Hat Enterprise Linux 9postgres-decoderbufsFixed0:2.4.0-1.Final.module+el9.4.0+20427+07482b8cRHSA-2025:14862
Red Hat Enterprise Linux 9postgresqlFixed0:16.10-1.module+el9.6.0+23420+848a4539RHSA-2025:14862
Red Hat Enterprise Linux 9postgresql-contribFixed0:13.22-1.el9_6RHSA-2025:14827
Red Hat Enterprise Linux 9postgresql-docsFixed0:15.14-1.module+el9.6.0+23419+7863ab62RHSA-2025:14827
Red Hat Enterprise Linux 9postgresql-plperlFixed0:13.22-1.el9_6RHSA-2025:14862
Red Hat Enterprise Linux 9postgresql-plpython3Fixed0:16.10-1.module+el9.6.0+23420+848a4539RHSA-2025:14862
Red Hat Enterprise Linux 9postgresql-pltclFixed0:16.10-1.module+el9.6.0+23420+848a4539RHSA-2025:14878
Red Hat Enterprise Linux 9postgresql-private-develFixed0:13.22-1.el9_6RHSA-2025:14862
Red Hat Enterprise Linux 9postgresql-private-libsFixed0:15.14-1.module+el9.6.0+23419+7863ab62RHSA-2025:14827
Red Hat Enterprise Linux 9postgresql-serverFixed0:15.14-1.module+el9.6.0+23419+7863ab62RHSA-2025:14827
Red Hat Enterprise Linux 9postgresql-server-develFixed0:16.10-1.module+el9.6.0+23420+848a4539RHSA-2025:14862
Red Hat Enterprise Linux 9postgresql-staticFixed0:13.22-1.el9_6RHSA-2025:14862
Red Hat Enterprise Linux 9postgresql-testFixed0:13.22-1.el9_6RHSA-2025:14827
Red Hat Enterprise Linux 9postgresql-test-rpm-macrosFixed0:13.22-1.el9_6RHSA-2025:14827
Red Hat Enterprise Linux 9postgresql-upgradeFixed0:15.14-1.module+el9.6.0+23419+7863ab62RHSA-2025:14878
Red Hat Enterprise Linux 9postgresql-upgrade-develFixed0:15.14-1.module+el9.6.0+23419+7863ab62RHSA-2025:14827
Red Hat Enterprise Linux 8pg_repackFixed0:1.5.1-1.module+el8.10.0+22551+c0330dc9RHSA-2025:15022
Red Hat Enterprise Linux 8pgauditFixed0:1.7.0-1.module+el8.9.0+19797+c4ce5969RHSA-2025:15021
Red Hat Enterprise Linux 8postgres-decoderbufsFixed0:0.10.0-2.module+el8.9.0+19330+c97ddbdfRHSA-2025:14899
Red Hat Enterprise Linux 8postgresqlFixed0:13.22-1.module+el8.10.0+23422+b659575fRHSA-2025:15115
Red Hat Enterprise Linux 8postgresql-contribFixed0:12.22-5.module+el8.10.0+23469+cd66ea30RHSA-2025:15022
Red Hat Enterprise Linux 8postgresql-docsFixed0:15.14-1.module+el8.10.0+23423+5a199198RHSA-2025:14899
Red Hat Enterprise Linux 8postgresql-plperlFixed0:15.14-1.module+el8.10.0+23423+5a199198RHSA-2025:15115
Red Hat Enterprise Linux 8postgresql-plpython3Fixed0:12.22-5.module+el8.10.0+23469+cd66ea30RHSA-2025:15021
Red Hat Enterprise Linux 8postgresql-pltclFixed0:15.14-1.module+el8.10.0+23423+5a199198RHSA-2025:15021
Red Hat Enterprise Linux 8postgresql-private-develFixed0:15.14-1.module+el8.10.0+23423+5a199198RHSA-2025:14899
Red Hat Enterprise Linux 8postgresql-private-libsFixed0:16.10-1.module+el8.10.0+23424+e26efc6cRHSA-2025:15022
Red Hat Enterprise Linux 8postgresql-serverFixed0:13.22-1.module+el8.10.0+23422+b659575fRHSA-2025:14899
Red Hat Enterprise Linux 8postgresql-server-develFixed0:16.10-1.module+el8.10.0+23424+e26efc6cRHSA-2025:15021
Red Hat Enterprise Linux 8postgresql-staticFixed0:15.14-1.module+el8.10.0+23423+5a199198RHSA-2025:15021
Red Hat Enterprise Linux 8postgresql-testFixed0:16.10-1.module+el8.10.0+23424+e26efc6cRHSA-2025:15022
Red Hat Enterprise Linux 8postgresql-test-rpm-macrosFixed0:13.22-1.module+el8.10.0+23422+b659575fRHSA-2025:14899
Red Hat Enterprise Linux 8postgresql-upgradeFixed0:15.14-1.module+el8.10.0+23423+5a199198RHSA-2025:15115
Red Hat Enterprise Linux 8postgresql-upgrade-develFixed0:16.10-1.module+el8.10.0+23424+e26efc6cRHSA-2025:15021
Red Hat Enterprise Linux 7postgresqlNot affected
Red Hat Enterprise Linux 7postgresql-contribNot affected
Red Hat Enterprise Linux 7postgresql-develNot affected
Red Hat Enterprise Linux 7postgresql-docsNot affected
Red Hat Enterprise Linux 7postgresql-libsNot affected
Red Hat Enterprise Linux 7postgresql-plperlNot affected
Red Hat Enterprise Linux 7postgresql-plpythonNot affected
Red Hat Enterprise Linux 7postgresql-pltclNot affected
Red Hat Enterprise Linux 7postgresql-serverNot affected
Red Hat Enterprise Linux 7postgresql-staticNot affected
Red Hat Enterprise Linux 7postgresql-testNot affected
Red Hat Enterprise Linux 7postgresql-upgradeNot affected
Red Hat Enterprise Linux 6postgresqlWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-contribWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-develWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-docsWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-libsWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-plperlWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-plpythonWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-pltclWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-serverWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-testWill not fix
Out of support scope
AlmaLinux 10postgresql-test-rpm-macrosFixed16.10-1.el10_0ALSA-2025:14826
AlmaLinux 9pg_repackFixed1.5.1-1.module_el9.6.0+146+c54fdecaALSA-2025:14862
AlmaLinux 9pgauditFixed16.0-1.module_el9.4.0+66+eb9878bcALSA-2025:14862
AlmaLinux 9pgvectorFixed0.6.2-2.module_el9.6.0+167+4e561146ALSA-2025:14827
AlmaLinux 9postgres-decoderbufsFixed1.9.7-1.Final.module_el9.3.0+52+21733919ALSA-2025:14827
AlmaLinux 9postgresqlFixed13.22-1.el9_6ALSA-2025:14827
AlmaLinux 9postgresql-contribFixed15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14878
AlmaLinux 9postgresql-docsFixed16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14878
AlmaLinux 9postgresql-plperlFixed15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14827
AlmaLinux 9postgresql-plpython3Fixed15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14878
AlmaLinux 9postgresql-pltclFixed13.22-1.el9_6ALSA-2025:14862
AlmaLinux 9postgresql-private-develFixed16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14878
AlmaLinux 9postgresql-private-libsFixed16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14862
AlmaLinux 9postgresql-serverFixed16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14878
AlmaLinux 9postgresql-server-develFixed16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14862
AlmaLinux 9postgresql-staticFixed16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14862
AlmaLinux 9postgresql-testFixed15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14827
AlmaLinux 9postgresql-test-rpm-macrosFixed16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14862
AlmaLinux 9postgresql-upgradeFixed16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14862
AlmaLinux 9postgresql-upgrade-develFixed16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14878
AlmaLinux 8pg_repackFixed1.4.6-3.module_el8.6.0+2760+1746ec94ALSA-2025:14899
AlmaLinux 8pgauditFixed1.7.0-1.module_el8.9.0+3706+885c732eALSA-2025:15021
AlmaLinux 8postgres-decoderbufsFixed0.10.0-2.module_el8.6.0+2760+1746ec94ALSA-2025:15115
AlmaLinux 8postgresqlFixed12.22-5.module_el8.10.0+4043+6cac3079ALSA-2025:15022
AlmaLinux 8postgresql-contribFixed12.22-5.module_el8.10.0+4043+6cac3079ALSA-2025:14899
AlmaLinux 8postgresql-docsFixed13.22-1.module_el8.10.0+4042+cb252986ALSA-2025:15115
AlmaLinux 8postgresql-plperlFixed16.10-1.module_el8.10.0+4038+0fbad93cALSA-2025:15021
AlmaLinux 8postgresql-plpython3Fixed15.14-1.module_el8.10.0+4041+afd30bb4ALSA-2025:15021
AlmaLinux 8postgresql-pltclFixed12.22-5.module_el8.10.0+4043+6cac3079ALSA-2025:14899
AlmaLinux 8postgresql-private-develFixed16.10-1.module_el8.10.0+4038+0fbad93cALSA-2025:15022
AlmaLinux 8postgresql-private-libsFixed16.10-1.module_el8.10.0+4038+0fbad93cALSA-2025:15022
AlmaLinux 8postgresql-serverFixed12.22-5.module_el8.10.0+4043+6cac3079ALSA-2025:14899
AlmaLinux 8postgresql-server-develFixed15.14-1.module_el8.10.0+4041+afd30bb4ALSA-2025:15115
AlmaLinux 8postgresql-staticFixed13.22-1.module_el8.10.0+4042+cb252986ALSA-2025:14899
AlmaLinux 8postgresql-testFixed12.22-5.module_el8.10.0+4043+6cac3079ALSA-2025:15021
AlmaLinux 8postgresql-test-rpm-macrosFixed16.10-1.module_el8.10.0+4038+0fbad93cALSA-2025:15115
AlmaLinux 8postgresql-upgradeFixed13.22-1.module_el8.10.0+4042+cb252986ALSA-2025:14899
AlmaLinux 8postgresql-upgrade-develFixed13.22-1.module_el8.10.0+4042+cb252986ALSA-2025:14899
Rocky Linux 10postgresql16Fixed0:16.10-1.el10_0RLSA-2025:14826
Rocky Linux 9pg_repackFixed0:1.4.8-2.module+el9.5.0+30637+4391fccaRLSA-2025:14827
Rocky Linux 9pgauditFixed0:1.7.0-1.module+el9.5.0+30637+4391fccaRLSA-2025:14827
Rocky Linux 9postgres-decoderbufsFixed0:2.4.0-1.Final.module+el9.5.0+30638+72f697e1RLSA-2025:14862
Rocky Linux 9postgresqlFixed0:13.22-1.el9_6RLSA-2025:14878
Rocky Linux 8pg_repackFixed0:1.4.6-3.module+el8.10.0+1862+29bef648RLSA-2025:15115
Rocky Linux 8pgauditFixed0:1.7.0-1.module+el8.9.0+1525+fc91df60RLSA-2025:14899
Rocky Linux 8postgres-decoderbufsFixed0:0.10.0-2.module+el8.9.0+1594+4a6adae9RLSA-2025:14899
Rocky Linux 8postgresqlFixed0:13.22-1.module+el8.10.0+2059+b61e6896RLSA-2025:15022
Alpine Linux 3.24postgresql16Fixed16.10-r0ALPINE-CVE-2025-8715
Alpine Linux 3.24postgresql17Fixed17.6-r0ALPINE-CVE-2025-8715
Alpine Linux 3.23postgresql16Fixed16.10-r0ALPINE-CVE-2025-8715
Alpine Linux 3.23postgresql17Fixed17.6-r0ALPINE-CVE-2025-8715
Alpine Linux 3.22postgresql15Fixed15.14-r0ALPINE-CVE-2025-8715
Alpine Linux 3.22postgresql16Fixed16.10-r0ALPINE-CVE-2025-8715
Alpine Linux 3.22postgresql17Fixed17.6-r0ALPINE-CVE-2025-8715
Alpine Linux 3.21postgresql15Fixed15.17-r0ALPINE-CVE-2025-8715
Alpine Linux 3.21postgresql16Fixed16.10-r0ALPINE-CVE-2025-8715
Alpine Linux 3.21postgresql17Fixed17.6-r0ALPINE-CVE-2025-8715
Alpine Linux 3.20postgresql15Fixed15.14-r0ALPINE-CVE-2025-8715
Alpine Linux 3.20postgresql16Fixed16.10-r0ALPINE-CVE-2025-8715
Alpine Linux 3.19postgresql15Fixed15.14-r0ALPINE-CVE-2025-8715
Alpine Linux 3.19postgresql16Fixed16.10-r0ALPINE-CVE-2025-8715

What the vendor says

As published in the CVE record by PostgreSQL, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Workaround: To block attacks against the psql client, use "pg_restore --dbname" instead of restore methods that involve "psql". To block SQL injection against the restore target server, revoke the CREATE permission from non-superusers at the origin server.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.