CVE-2024-10978
JSON

4.2medium

PostgreSQL SET ROLE, SET SESSION AUTHORIZATION reset to wrong user ID

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

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.

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, 17.0NVD
debian debian_linux11.0NVD
postgresql (Bitnami)before 12.21.0, from 13.0.0 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
NVD4.2medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N
Bitnami Vulnerability Databasemedium rating

Classification

CWE-266

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

What each source says

CVE List

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.

NVD (es)

La asignación incorrecta de privilegios en PostgreSQL permite que un usuario de la aplicación con menos privilegios vea o cambie filas distintas a las previstas. Un ataque requiere que la aplicación utilice SET ROLE, SET SESSION AUTHORIZATION o una función equivalente. El problema surge cuando una consulta de la aplicación utiliza parámetros del atacante o transmite los resultados de la consulta al atacante. Si esa consulta reacciona a current_setting('role') o al ID de usuario actual, puede modificar o devolver datos como si la sesión no hubiera utilizado SET ROLE o SET SESSION AUTHORIZATION. El atacante no controla qué ID de usuario incorrecto se aplica. El texto de la consulta de fuentes con menos privilegios no es un problema aquí, porque SET ROLE y SET SESSION AUTHORIZATION no son entornos aislados para consultas no verificadas. 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-10978 changed 2025-11-03CVE Terms of Use
NVDCVE-2024-10978 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-POSTGRESQL-2024-10978 changed 2026-09-08Apache-2.0