Vulnerability · Published Aug 14, 2025 · Assigned by PostgreSQL

CVE-2025-8713PostgreSQL optimizer statistics can expose sampled data within a view, partition, or child table

Low 3.1

In plain English

A low-severity security flaw in PostgreSQL. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 18% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)3.1Low
Exploit odds (30 days)0.3%top 81.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

PostgreSQL optimizer statistics allow a user to read sampled data within a view that the user cannot access. Separately, statistics allow a user to read sampled data that a row security policy intended to hide. PostgreSQL maintains statistics for tables by sampling data available in columns; this data is consulted during the query planning process. Prior to this release, a user could craft a leaky operator that bypassed view access control lists (ACLs) and bypassed row security policies in partitioning or table inheritance hierarchies. Reachable statistics data notably included histograms and most-common-values lists. CVE-2017-7484 and CVE-2019-10130 intended to close this class of vulnerability, but this gap remained. Versions before PostgreSQL 17.6, 16.10, 15.14, 14.19, and 13.22 are affected.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:9pg_repack1.5.1-1.module_el9.6.0+146+c54fdecaALSA-2025:14827
AlmaLinux:9pg_repack1.4.8-2.module_el9.5.0+119+18833d03ALSA-2025:14862
AlmaLinux:9pgaudit16.0-1.module_el9.4.0+66+eb9878bcALSA-2025:14827
AlmaLinux:9pgaudit1.7.0-1.module_el9.3.0+52+21733919ALSA-2025:14862
AlmaLinux:9pgvector0.6.2-2.module_el9.6.0+167+4e561146ALSA-2025:14827
AlmaLinux:9postgres-decoderbufs1.9.7-1.Final.module_el9.3.0+52+21733919ALSA-2025:14862
AlmaLinux:9postgres-decoderbufs2.4.0-1.Final.module_el9.4.0+66+eb9878bcALSA-2025:14827
AlmaLinux:9postgresql16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-contrib16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-contrib15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-docs15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-docs16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-plperl16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-plperl15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-plpython315.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-plpython316.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-pltcl15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-pltcl16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-private-devel15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-private-devel16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-private-libs15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-private-libs16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-server16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-server15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-server-devel16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-server-devel15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-static16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-static15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-test16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-test15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-test-rpm-macros15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-test-rpm-macros16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-upgrade16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-upgrade15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
AlmaLinux:9postgresql-upgrade-devel16.10-1.module_el9.6.0+174+80cb77f0ALSA-2025:14827
AlmaLinux:9postgresql-upgrade-devel15.14-1.module_el9.6.0+176+c508cfa2ALSA-2025:14862
Alpine:v3.20postgresql1515.14-r0ALPINE-CVE-2025-8713
Alpine:v3.21postgresql1515.17-r0ALPINE-CVE-2025-8713
Alpine:v3.22postgresql1515.14-r0ALPINE-CVE-2025-8713
Alpine:v3.20postgresql1616.10-r0ALPINE-CVE-2025-8713
Alpine:v3.21postgresql1616.10-r0ALPINE-CVE-2025-8713
Alpine:v3.22postgresql1616.10-r0ALPINE-CVE-2025-8713
Alpine:v3.23postgresql1616.10-r0ALPINE-CVE-2025-8713
Alpine:v3.24postgresql1616.10-r0ALPINE-CVE-2025-8713
Alpine:v3.21postgresql1717.6-r0ALPINE-CVE-2025-8713
Alpine:v3.22postgresql1717.6-r0ALPINE-CVE-2025-8713
Alpine:v3.23postgresql1717.6-r0ALPINE-CVE-2025-8713
Alpine:v3.24postgresql1717.6-r0ALPINE-CVE-2025-8713
Debian:12postgresql-1515.14-0+deb12u1DEBIAN-CVE-2025-8713
Debian:13postgresql-1717.6-0+deb13u1DEBIAN-CVE-2025-8713
Ubuntu:22.04:LTSpostgresql-1414.19-0ubuntu0.22.04.1USN-7741-1
Ubuntu:22.04:LTSpostgresql-1414.19-0ubuntu0.22.04.1UBUNTU-CVE-2025-8713
Ubuntu:24.04:LTSpostgresql-1616.10-0ubuntu0.24.04.1USN-7741-1
Ubuntu:24.04:LTSpostgresql-1616.10-0ubuntu0.24.04.1UBUNTU-CVE-2025-8713
Ubuntu:25.10postgresql-1717.6-1UBUNTU-CVE-2025-8713

Affected products (as reported)

VendorProductVersions
n/a PostgreSQL 17 – before 17.616 – before 16.1015 – before 15.1414 – before 14.190 – before 13.22

Weakness: CWE-1230 · Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N

References