CVE-2024-10976
JSON

4.2medium

PostgreSQL row security below e.g. subqueries disregards user ID changes

Severity
4.2medium CVSS:3.1 by PostgreSQL
Exploit likelihood
0.77% (higher than 56% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
PostgreSQL
Also known as
BIT-POSTGRESQL-2024-10976

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.

Affected

Product or packageVersionsReported by
PostgreSQLfrom 17 before 17.1, from 16 before 16.5, from 15 before 15.9, from 14 before 14.14, from 13 before 13.17, before 12.21CVE List
postgresql postgresqlfrom 12.0 before 12.21, from 13.0 before 13.17, from 14.0 before 14.14, from 15.0 before 15.9, from 16.0 before 16.5, from 17.0 before 17.1NVD
postgresql (Bitnami)before 13.17.0, from 14.0.0 before 14.14.0, from 15.0.0 before 15.9.0, from 16.0.0 before 16.5.0, from 17.0.0 before 17.1.0Bitnami Vulnerability Database

All scores

PostgreSQL4.2medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N
NVD5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Bitnami Vulnerability Databasemedium rating

Classification

CWE-1250

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

El seguimiento incompleto en PostgreSQL de tablas con seguridad de filas permite que una consulta reutilizada vea o cambie filas diferentes a las previstas. CVE-2023-2455 y CVE-2016-2193 solucionaron la mayoría de las interacciones entre la seguridad de filas y los cambios de ID de usuario. Pasaron por alto los casos en los que una subconsulta, una consulta WITH, una vista de invocador de seguridad o una función de lenguaje SQL hace referencia a una tabla con una política de seguridad a nivel de fila. Esto tiene las mismas consecuencias que las dos CVE anteriores. Es decir, conduce a la aplicación de políticas potencialmente incorrectas en los casos en los que se utilizan políticas específicas de roles y se planifica una consulta determinada bajo un rol y luego se ejecuta bajo otros roles. Este escenario puede ocurrir bajo funciones de definidor de seguridad o cuando se planifica inicialmente un usuario y una consulta comunes y luego se reutilizan en varios SET ROLE. La aplicación de una política incorrecta puede permitir que un usuario complete lecturas y modificaciones que de otro modo estarían prohibidas. Esto afecta solo a las bases de datos que han utilizado CREATE POLICY para definir una política de seguridad de filas. Un atacante debe adaptar un ataque al patrón de reutilización de planes de consulta, cambios de ID de usuario y políticas de seguridad de filas específicas de roles de una aplicación en particular. Las versiones anteriores a PostgreSQL 17.1, 16.5, 15.9, 14.14, 13.17 y 12.21 se ven afectadas.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-10976 changed 2025-11-03CVE Terms of Use
NVDCVE-2024-10976 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-POSTGRESQL-2024-10976 changed 2026-09-10Apache-2.0