Cloudanix VulnDB

CVE-2024-10976

None

CVSS

—

EPSS

0.8%

Published

Nov 14, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A database flaw could let users see or change rows they are not supposed to access when queries get reused while switching roles in systems with custom row access rules.

Exploitation
Remote Authenticated
Attacker needs
Low Privilege
Complexity
High
Impact
Data Exposure
Component
Application
Class
Authorization Bypass
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Incomplete tracking of row-level security policies during query plan reuse across role or user ID changes allows subqueries, WITH queries, security invoker views, or SQL-language functions to apply incorrect policies, permitting reads or modifications of unauthorized rows.

Why it matters to the business

Databases using row security policies may experience unauthorized data exposure or tampering when queries are reused across role changes, increasing breach risk in multi-tenant or role-based access environments; low urgency due to absence from KEV and stable low EPSS.

How an attack unfolds

An attacker identifies an application pattern involving security definer functions or SET ROLE combined with row security policies, then crafts a query planned under one role but executed under another to bypass intended row restrictions via subqueries or similar constructs.

How to fix it

Upgrade PostgreSQL to 17.1, 16.5, 15.9, 14.14, 13.17, or 12.21 or later; review and test all row security policies after upgrade.

How to confirm the fix worked

Verify installed version against fixed releases; exercise test cases with row security policies, subqueries, and role changes to confirm correct policy application.

Typical attack path

  1. Map application usage of CREATE POLICY row security combined with role switches or security definer functions
  2. Craft a query containing subqueries, CTEs, or invoker views that triggers plan caching under one role
  3. Reuse the cached plan under a different role to access rows forbidden by the intended policy
  4. Perform unauthorized reads or modifications

How to detect it

Review PostgreSQL query logs and audit logs for repeated plans involving subqueries or functions on tables with row security policies; correlate with role changes via SET ROLE or security definer execution; look for access to rows outside expected policy results.

What your security team should do

  • Apply the listed PostgreSQL updates as soon as possible
  • Audit all databases using CREATE POLICY for role-specific rules
  • Disable or rewrite security definer functions and SET ROLE patterns pending patching if feasible
  • Add monitoring for unexpected row access patterns in security-sensitive tables

The record

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 packages

Ecosystem Package Introduced Fixed
AlmaLinux:8 pg_repack 0 1.4.6-3.module_el8.6.0+2760+1746ec94
AlmaLinux:8 pg_repack 0 1.4.6-3.module_el8.9.0+3704+f1f917ce
AlmaLinux:8 pg_repack 0 1.4.8-1.module_el8.10.0+3798+606ebb9f
AlmaLinux:8 pg_repack 0 1.4.8-1.module_el8.9.0+3706+885c732e
AlmaLinux:8 pg_repack 0 1.5.1-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 pgaudit 0 1.4.0-7.module_el8.10.0+3889+48cb11fb.alma.1
AlmaLinux:8 pgaudit 0 1.4.0-7.module_el8.9.0+3740+0e74851f.alma.1
AlmaLinux:8 pgaudit 0 1.7.0-1.module_el8.9.0+3706+885c732e
AlmaLinux:8 pgaudit 0 16.0-1.module_el8.10.0+3798+606ebb9f
AlmaLinux:8 pgaudit 0 1.5.0-1.module_el8.6.0+2760+1746ec94
AlmaLinux:8 pgaudit 0 1.5.0-1.module_el8.6.0+3095+ee60d910
AlmaLinux:8 postgres-decoderbufs 0 0.10.0-2.module_el8.6.0+2760+1746ec94
AlmaLinux:8 postgres-decoderbufs 0 0.10.0-2.module_el8.6.0+3095+ee60d910
AlmaLinux:8 postgres-decoderbufs 0 0.10.0-2.module_el8.9.0+3704+f1f917ce
AlmaLinux:8 postgres-decoderbufs 0 1.9.7-1.Final.module_el8.9.0+3706+885c732e
AlmaLinux:8 postgres-decoderbufs 0 2.4.0-1.Final.module_el8.10.0+3798+606ebb9f
AlmaLinux:8 postgresql 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-contrib 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-contrib 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-contrib 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-contrib 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-docs 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-docs 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-docs 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-docs 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-plperl 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-plperl 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-plperl 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-plperl 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-plpython3 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-plpython3 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-plpython3 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-plpython3 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-pltcl 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-pltcl 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-pltcl 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-pltcl 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-private-devel 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-private-devel 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-private-libs 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-private-libs 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-server 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-server 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-server 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-server 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-server-devel 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-server-devel 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-server-devel 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-server-devel 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-static 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-static 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-static 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-static 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-test 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-test 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-test 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-test 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-test-rpm-macros 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-test-rpm-macros 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-test-rpm-macros 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-test-rpm-macros 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-upgrade 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-upgrade 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-upgrade 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-upgrade 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-upgrade-devel 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-upgrade-devel 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-upgrade-devel 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-upgrade-devel 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:9 pg_repack 0 1.4.8-2.module_el9.5.0+120+4533eb20
AlmaLinux:9 pg_repack 0 1.5.1-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 pg_repack 0 1.5.1-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 pgaudit 0 1.7.0-1.module_el9.3.0+52+21733919
AlmaLinux:9 pgaudit 0 16.0-1.module_el9.4.0+66+eb9878bc
AlmaLinux:9 pgvector 0 0.6.2-1.module_el9.5.0+120+4533eb20
AlmaLinux:9 postgres-decoderbufs 0 1.9.7-1.Final.module_el9.3.0+52+21733919
AlmaLinux:9 postgres-decoderbufs 0 2.4.0-1.Final.module_el9.4.0+66+eb9878bc
AlmaLinux:9 postgresql 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql 0 13.18-1.el9_5
AlmaLinux:9 postgresql-contrib 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-contrib 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-contrib 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-contrib 0 13.18-1.el9_5
AlmaLinux:9 postgresql-docs 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-docs 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-docs 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-docs 0 13.18-1.el9_5
AlmaLinux:9 postgresql-plperl 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-plperl 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-plperl 0 13.18-1.el9_5
AlmaLinux:9 postgresql-plpython3 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-plpython3 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-plpython3 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-plpython3 0 13.18-1.el9_5
AlmaLinux:9 postgresql-pltcl 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-pltcl 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-pltcl 0 13.18-1.el9_5
AlmaLinux:9 postgresql-private-devel 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-private-devel 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-private-devel 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-private-devel 0 13.18-1.el9_5
AlmaLinux:9 postgresql-private-libs 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-private-libs 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-private-libs 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-private-libs 0 13.18-1.el9_5
AlmaLinux:9 postgresql-server 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-server 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-server 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-server 0 13.18-1.el9_5
AlmaLinux:9 postgresql-server-devel 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-server-devel 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-server-devel 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-server-devel 0 13.18-1.el9_5
AlmaLinux:9 postgresql-static 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-static 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-static 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-static 0 13.18-1.el9_5
AlmaLinux:9 postgresql-test 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-test 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-test 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-test 0 13.18-1.el9_5
AlmaLinux:9 postgresql-test-rpm-macros 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-test-rpm-macros 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-test-rpm-macros 0 13.18-1.el9_5
AlmaLinux:9 postgresql-upgrade 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-upgrade 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-upgrade 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-upgrade 0 13.18-1.el9_5
AlmaLinux:9 postgresql-upgrade-devel 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-upgrade-devel 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-upgrade-devel 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-upgrade-devel 0 13.18-1.el9_5
Alpine:v3.17 postgresql14 0 14.14-r0
Alpine:v3.17 postgresql15 0 15.9-r0
Alpine:v3.18 postgresql14 0 14.14-r0
Alpine:v3.18 postgresql15 0 15.9-r0
Alpine:v3.19 postgresql15 0 15.9-r0
Alpine:v3.19 postgresql16 0 16.5-r0
Alpine:v3.20 postgresql15 0 15.9-r0
Alpine:v3.20 postgresql16 0 16.5-r0
Alpine:v3.21 postgresql16 0 16.5-r0
Alpine:v3.21 postgresql17 0 17.1-r0
Alpine:v3.22 postgresql16 0 16.5-r0
Alpine:v3.22 postgresql17 0 17.1-r0
Bitnami postgresql 0 13.17.0
Bitnami postgresql 17.0.0 17.1.0
Chainguard ecpg-13 0 13.17-r0
Chainguard ecpg-14 0 14.14-r0
Chainguard ecpg-15 0 15.9-r0
Chainguard ecpg-16 0 16.5-r0
Chainguard ecpg-17 0 17.1-r0
Chainguard libecpg-12 0 12.21-r0
Chainguard libecpg-13 0 13.17-r0
Chainguard libecpg-13-dev 0 13.17-r0
Chainguard libecpg-14 0 14.14-r0
Chainguard libecpg-14-dev 0 14.14-r0
Chainguard libecpg-15 0 15.9-r0
Chainguard libecpg-15-dev 0 15.9-r0
Chainguard libecpg-16 0 16.5-r0
Chainguard libecpg-16-dev 0 16.5-r0
Chainguard libecpg-17 0 17.1-r0
Chainguard libecpg-17-dev 0 17.1-r0
Chainguard libpq-12 0 12.21-r0
Chainguard libpq-13 0 13.17-r0
Chainguard libpq-14 0 14.14-r0
Chainguard libpq-15 0 15.9-r0
Chainguard libpq-16 0 16.5-r0
Chainguard libpq-17 0 17.1-r0
Chainguard postgresql-12 0 12.21-r0
Chainguard postgresql-12-base 0 12.21-r0
Chainguard postgresql-12-bitnami-compat 0 12.21-r0
Chainguard postgresql-12-client 0 12.21-r0
Chainguard postgresql-12-client-base 0 12.21-r0
Chainguard postgresql-12-contrib 0 12.21-r0
Chainguard postgresql-12-dev 0 12.21-r0
Chainguard postgresql-12-oci-entrypoint 0 12.21-r0
Chainguard postgresql-12-oci-entrypoint-base 0 12.21-r0
Chainguard postgresql-12-pgadmin-compat 0 12.21-r0
Chainguard postgresql-13 0 13.17-r0
Chainguard postgresql-13-base 0 13.17-r0
Chainguard postgresql-13-bitnami-compat 0 13.17-r0
Chainguard postgresql-13-client 0 13.17-r0
Chainguard postgresql-13-client-base 0 13.17-r0
Chainguard postgresql-13-contrib 0 13.17-r0
Chainguard postgresql-13-dev 0 13.17-r0
Chainguard postgresql-13-oci-entrypoint 0 13.17-r0
Chainguard postgresql-13-oci-entrypoint-base 0 13.17-r0
Chainguard postgresql-13-pgadmin-compat 0 13.17-r0
Chainguard postgresql-14 0 14.14-r0
Chainguard postgresql-14-base 0 14.14-r0
Chainguard postgresql-14-bitnami-compat 0 14.14-r0
Chainguard postgresql-14-client 0 14.14-r0
Chainguard postgresql-14-client-base 0 14.14-r0
Chainguard postgresql-14-contrib 0 14.14-r0
Chainguard postgresql-14-dev 0 14.14-r0

Related vulnerabilities