# CVE-2024-4317: PostgreSQL pg_stats_ext and pg_stats_ext_exprs lack authorization checks

> Unprivileged users can read sensitive statistics from other users' data due to missing authorization checks in PostgreSQL views.

- **Severity:** Low 3.1 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 May 2024
- **Updated:** 28 Mar 2025
- **Also known as:** AZL-40654, BELL-CVE-2024-4317, BIT-postgresql-2024-4317, DEBIAN-CVE-2024-4317, ECHO-dd9c-b422-c001, GHSA-37xw-rpjg-xxfx, JLSEC-2026-51, MGASA-2024-0184, MINI-c5h9-w3gf-5ghw, SUSE-SU-2024:1651-1, SUSE-SU-2024:1652-1, SUSE-SU-2024:1653-1, SUSE-SU-2024:1703-1, SUSE-SU-2024:1768-1, SUSE-SU-2024:1777-1, SUSE-SU-2024:2261-1, SUSE-SU-2024:2262-1, SUSE-SU-2024:2262-2, SUSE-SU-2024:2262-3, SUSE-SU-2024:2266-1, UBUNTU-CVE-2024-4317, USN-6802-1, openSUSE-SU-2024:13946-1, openSUSE-SU-2024:13947-1, openSUSE-SU-2024:13950-1

## What is CVE-2024-4317?

CVE-2024-4317 is a low-severity missing authorization vulnerability in Postgresql Postgresql, published on 9 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Missing authorization in PostgreSQL built-in views pg_stats_ext and pg_stats_ext_exprs allows an unprivileged database user to read most common values and other statistics from CREATE STATISTICS commands of other users. The most common values may reveal column values the eavesdropper could not otherwise read or results of functions they cannot execute. Installing an unaffected version only fixes fresh PostgreSQL installations, namely those that are created with the initdb utility after installing that version. Current PostgreSQL installations will remain vulnerable until they follow the instructions in the release notes. Within major versions 14-16, minor versions before PostgreSQL 16.3, 15.7, and 14.12 are affected. Versions before PostgreSQL 14 are unaffected.

Weakness: CWE-862 (Missing Authorization)

## Which versions are affected by CVE-2024-4317?

1 open source package ship an affected version, including postgresql. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `postgresql` | Bitnami | From 14.0.0 | 14.12.0, 15.7.0, 16.3.0 |
| `postgresql15` | SUSE:Linux Enterprise Module for Basesystem 15 SP5 | All versions | 15.7-150200.5.27.1 |
| `postgresql16` | SUSE:Linux Enterprise Module for Basesystem 15 SP5 | All versions | 16.3-150200.5.13.1 |
| `postgresql16` | SUSE:Linux Enterprise Module for Basesystem 15 SP6 | All versions | 16.2-150600.16.2.1 |
| `postgresql14` | SUSE:Linux Enterprise Module for Legacy 15 SP5 | All versions | 14.12-150200.5.44.1 |
| `postgresql14` | SUSE:Linux Enterprise Module for Legacy 15 SP6 | All versions | 14.12-150600.16.3.1 |
| `postgresql14` | SUSE:Linux Enterprise Module for Legacy 15 SP6 | All versions | 14.12-150600.16.3.1 |
| `postgresql15` | SUSE:Linux Enterprise Module for Legacy 15 SP6 | All versions | 15.7-150600.16.3.1 |
| `postgresql14` | SUSE:Linux Enterprise Module for Package Hub 15 SP5 | All versions | 14.12-150200.5.44.1 |
| `postgresql16` | SUSE:Linux Enterprise Module for Package Hub 15 SP5 | All versions | 16.3-150200.5.13.1 |
| `postgresql14` | SUSE:Linux Enterprise Module for Package Hub 15 SP6 | All versions | 14.12-150600.16.3.1 |
| `postgresql15` | SUSE:Linux Enterprise Module for Server Applications 15 SP5 | All versions | 15.7-150200.5.27.1 |
| `postgresql16` | SUSE:Linux Enterprise Module for Server Applications 15 SP5 | All versions | 16.3-150200.5.13.1 |
| `postgresql16` | SUSE:Linux Enterprise Module for Server Applications 15 SP6 | All versions | 16.2-150600.16.2.1 |
| `postgresql14` | SUSE:Linux Enterprise Server 12 SP5 | All versions | 14.12-3.41.1 |
| `postgresql15` | SUSE:Linux Enterprise Server 12 SP5 | All versions | 15.7-3.25.1 |
| `postgresql16` | SUSE:Linux Enterprise Server 12 SP5 | All versions | 16.3-3.13.1 |
| `postgresql14` | SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 14.12-3.41.1 |
| `postgresql15` | SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 15.7-3.25.1 |
| `postgresql16` | SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 16.3-3.13.1 |
| `postgresql14` | SUSE:Linux Enterprise Software Development Kit 12 SP5 | All versions | 14.12-3.41.1 |
| `postgresql15` | SUSE:Linux Enterprise Software Development Kit 12 SP5 | All versions | 15.7-3.25.1 |
| `postgresql16` | SUSE:Linux Enterprise Software Development Kit 12 SP5 | All versions | 16.3-3.13.1 |
| `postgresql14` | openSUSE:Leap 15.5 | All versions | 14.12-150200.5.44.1 |
| `postgresql15` | openSUSE:Leap 15.5 | All versions | 15.7-150200.5.27.1 |
| `postgresql16` | openSUSE:Leap 15.5 | All versions | 16.3-150200.5.13.1 |
| `postgresql16-mini` | openSUSE:Leap 15.5 | All versions | 16.3-150200.5.13.1 |
| `postgresql14` | openSUSE:Leap 15.6 | All versions | 14.12-150600.16.3.1 |
| `postgresql15` | openSUSE:Leap 15.6 | All versions | 15.7-150600.16.3.1 |
| `postgresql16` | openSUSE:Leap 15.6 | All versions | 16.2-150600.16.2.1 |
| `postgresql14` | openSUSE:Tumbleweed | All versions | 14.12-1.1 |
| `postgresql15` | openSUSE:Tumbleweed | All versions | 15.7-1.1 |
| `postgresql16` | openSUSE:Tumbleweed | All versions | 16.3-1.1 |

Products: Postgresql Postgresql.

## How do I fix CVE-2024-4317?

Upgrade postgresql to a fixed version for your release line: 14.12.0, 15.7.0 or 16.3.0.

## Is CVE-2024-4317 being exploited?

There is no known exploitation of CVE-2024-4317 in the wild and no public exploit code.

## Other vulnerabilities in Postgresql Postgresql

- [CVE-2013-1902](https://insights.sbomify.com/CVE-2013-1902/): Information disclosure in n/a (critical 10.0)
- [CVE-2013-1903](https://insights.sbomify.com/CVE-2013-1903/): Information disclosure in n/a (critical 10.0)
- [CVE-2007-3279](https://insights.sbomify.com/CVE-2007-3279/): Privilege escalation in n/a (critical 10.0)
- [CVE-2002-1399](https://insights.sbomify.com/CVE-2002-1399/): Integer overflow in n/a (critical 10.0)
- [CVE-2016-3065](https://insights.sbomify.com/CVE-2016-3065/): Information disclosure in n/a (critical 9.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-4317 and fix it if it is affected.

What it is: CVE-2024-4317 is a low-severity missing authorization vulnerability in Postgresql Postgresql, published on 9 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-4317 in the wild and no public exploit code.

Affected packages and fixed versions:
- postgresql (Bitnami): affected from 14.0.0; fixed in 14.12.0, 15.7.0, 16.3.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-4317/ (Markdown: https://insights.sbomify.com/CVE-2024-4317/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-4317
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-4317
- OSV: https://osv.dev/vulnerability/CVE-2024-4317

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-4317/
Summaries are generated and may contain mistakes; the official description above is the record.
