# CVE-2024-10978: PostgreSQL SET ROLE, SET SESSION AUTHORIZATION reset to wrong user ID

> A privilege escalation flaw in PostgreSQL allows attackers to view or modify unintended rows when applications use SET ROLE or SET SESSION AUTHORIZATION.

- **Severity:** Medium 4.2 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/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:** 14 Nov 2024
- **Updated:** 3 Nov 2025
- **Also known as:** ALPINE-CVE-2024-10978, AZL-53204, AZL-53209, BELL-CVE-2024-10978, BIT-postgresql-2024-10978, CLEANSTART-2026-NO21285, CLSA-2025-1747432102, DEBIAN-CVE-2024-10978, ECHO-9aa9-6da5-918f, GHSA-37v9-jh5m-f5pg, JLSEC-2026-49, MINI-hr34-cm42-92xw, MINI-m775-3hw9-rh8f, MINI-p54r-p98h-46w9, UBUNTU-CVE-2024-10978

## What is CVE-2024-10978?

CVE-2024-10978 is a medium-severity vulnerability in Debian Debian Linux, published on 14 Nov 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Incorrect privilege assignment in PostgreSQL allows a less-privileged application user to view or change different rows from those intended.  An attack requires the application to use SET ROLE, SET SESSION AUTHORIZATION, or an equivalent feature.  The problem arises when an application query uses parameters from the attacker or conveys query results to the attacker.  If that query reacts to current_setting('role') or the current user ID, it may modify or return data as though the session had not used SET ROLE or SET SESSION AUTHORIZATION.  The attacker does not control which incorrect user ID applies.  Query text from less-privileged sources is not a concern here, because SET ROLE and SET SESSION AUTHORIZATION are not sandboxes for unvetted queries.  Versions before PostgreSQL 17.1, 16.5, 15.9, 14.14, 13.17, and 12.21 are affected.

Weakness: CWE-266 (Incorrect Privilege Assignment)

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

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `postgresql` | Bitnami | All versions | 12.21.0, 13.17.0, 14.14.0, 15.9.0, 16.5.0, 17.1.0 |

Products: Debian Debian Linux, Postgresql Postgresql.

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

Upgrade postgresql to a fixed version for your release line: 12.21.0, 13.17.0, 14.14.0 or 15.9.0.

## Is CVE-2024-10978 being exploited?

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

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-10978 is a medium-severity vulnerability in Debian Debian Linux, published on 14 Nov 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-10978 in the wild and no public exploit code.

Affected packages and fixed versions:
- postgresql (Bitnami): affected all versions; fixed in 12.21.0, 13.17.0, 14.14.0, 15.9.0, 16.5.0, 17.1.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-10978/ (Markdown: https://insights.sbomify.com/CVE-2024-10978/index.md)
```

## Sources

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

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