CVE-2024-10976 PostgreSQL row security below e.g. subqueries disregards user ID changes

Medium 4.2 Published Updated

Attackers can bypass row-level security policies in PostgreSQL to read or modify unauthorized data when query plans are reused across role changes.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-10976?

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

Official description

Incomplete tracking in PostgreSQL of tables with row security allows a reused query to view or change different rows from those intended. CVE-2023-2455 and CVE-2016-2193 fixed most interaction between row security and user ID changes. They missed cases where a subquery, WITH query, security invoker view, or SQL-language function references a table with a row-level security policy. This has the same consequences as the two earlier CVEs. That is to say, it leads to potentially incorrect policies being applied in cases where role-specific policies are used and a given query is planned under one role and then executed under other roles. This scenario can happen under security definer functions or when a common user and query is planned initially and then re-used across multiple SET ROLEs. Applying an incorrect policy may permit a user to complete otherwise-forbidden reads and modifications. This affects only databases that have used CREATE POLICY to define a row security policy. An attacker must tailor an attack to a particular application's pattern of query plan reuse, user ID changes, and role-specific row security policies. Versions before PostgreSQL 17.1, 16.5, 15.9, 14.14, 13.17, and 12.21 are affected.

Weakness: CWE-1250

Which versions are affected by CVE-2024-10976?

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

PackageAffectedFixed in
postgresql BitnamiAll versions13.17.0, 14.14.0, 15.9.0, 16.5.0, 17.1.0

Products include Postgresql Postgresql.

How do I fix CVE-2024-10976?

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

Upgrade, and check permissions on every request on the server, not only in the interface. More about Missing authorization.

Is CVE-2024-10976 being exploited?

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

All Postgresql Postgresql vulnerabilities

Sources

Also known as ALPINE-CVE-2024-10976, AZL-53201, AZL-53215, BELL-CVE-2024-10976, BIT-postgresql-2024-10976, CLEANSTART-2026-WJ73898 and 8 more.

Is CVE-2024-10976 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free