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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:9 | pg_repack | 1.5.1-1.module_el9.6.0+146+c54fdeca | ALSA-2025:14827 |
| AlmaLinux:9 | pg_repack | 1.4.8-2.module_el9.5.0+119+18833d03 | ALSA-2025:14862 |
| AlmaLinux:9 | pgaudit | 16.0-1.module_el9.4.0+66+eb9878bc | ALSA-2025:14827 |
| AlmaLinux:9 | pgaudit | 1.7.0-1.module_el9.3.0+52+21733919 | ALSA-2025:14862 |
| AlmaLinux:9 | pgvector | 0.6.2-2.module_el9.6.0+167+4e561146 | ALSA-2025:14827 |
| AlmaLinux:9 | postgres-decoderbufs | 1.9.7-1.Final.module_el9.3.0+52+21733919 | ALSA-2025:14862 |
| AlmaLinux:9 | postgres-decoderbufs | 2.4.0-1.Final.module_el9.4.0+66+eb9878bc | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-contrib | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-contrib | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-docs | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-docs | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-plperl | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-plperl | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-plpython3 | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-plpython3 | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-pltcl | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-pltcl | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-private-devel | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-private-devel | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-private-libs | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-private-libs | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-server | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-server | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-server-devel | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-server-devel | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-static | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-static | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-test | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-test | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-test-rpm-macros | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-test-rpm-macros | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-upgrade | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-upgrade | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| AlmaLinux:9 | postgresql-upgrade-devel | 16.10-1.module_el9.6.0+174+80cb77f0 | ALSA-2025:14827 |
| AlmaLinux:9 | postgresql-upgrade-devel | 15.14-1.module_el9.6.0+176+c508cfa2 | ALSA-2025:14862 |
| Alpine:v3.20 | postgresql15 | 15.14-r0 | ALPINE-CVE-2025-8713 |
| Alpine:v3.21 | postgresql15 | 15.17-r0 | ALPINE-CVE-2025-8713 |
| Alpine:v3.22 | postgresql15 | 15.14-r0 | ALPINE-CVE-2025-8713 |
| Alpine:v3.20 | postgresql16 | 16.10-r0 | ALPINE-CVE-2025-8713 |
| Alpine:v3.21 | postgresql16 | 16.10-r0 | ALPINE-CVE-2025-8713 |
| Alpine:v3.22 | postgresql16 | 16.10-r0 | ALPINE-CVE-2025-8713 |
| Alpine:v3.23 | postgresql16 | 16.10-r0 | ALPINE-CVE-2025-8713 |
| Alpine:v3.24 | postgresql16 | 16.10-r0 | ALPINE-CVE-2025-8713 |
| Alpine:v3.21 | postgresql17 | 17.6-r0 | ALPINE-CVE-2025-8713 |
| Alpine:v3.22 | postgresql17 | 17.6-r0 | ALPINE-CVE-2025-8713 |
| Alpine:v3.23 | postgresql17 | 17.6-r0 | ALPINE-CVE-2025-8713 |
| Alpine:v3.24 | postgresql17 | 17.6-r0 | ALPINE-CVE-2025-8713 |
| Debian:12 | postgresql-15 | 15.14-0+deb12u1 | DEBIAN-CVE-2025-8713 |
| Debian:13 | postgresql-17 | 17.6-0+deb13u1 | DEBIAN-CVE-2025-8713 |
| Ubuntu:22.04:LTS | postgresql-14 | 14.19-0ubuntu0.22.04.1 | USN-7741-1 |
| Ubuntu:22.04:LTS | postgresql-14 | 14.19-0ubuntu0.22.04.1 | UBUNTU-CVE-2025-8713 |
| Ubuntu:24.04:LTS | postgresql-16 | 16.10-0ubuntu0.24.04.1 | USN-7741-1 |
| Ubuntu:24.04:LTS | postgresql-16 | 16.10-0ubuntu0.24.04.1 | UBUNTU-CVE-2025-8713 |
| Ubuntu:25.10 | postgresql-17 | 17.6-1 | UBUNTU-CVE-2025-8713 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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