CVE-2024-10976
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedIncomplete 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidencePostgreSQL has an incomplete tracking issue with row security policies where queries with subqueries, WITH queries, security invoker views, or SQL-language functions referencing tables with row-level security can apply incorrect policies when planned under one role and executed under another. This allows unauthorized row access/modification in security definer functions or when queries are reused across multiple SET ROLE operations.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data>= 12.0, < 12.21>= 13.0, < 13.17>= 14.0, < 14.14>= 15.0, < 15.9>= 16.0, < 16.5>= 17.0, < 17.1CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Check PostgreSQL versionRun: SELECT version(); or psql --versionAffected if The installed version falls within the affected ranges: 12.0-12.20, 13.0-13.16, 14.0-14.13, 15.0-15.8, 16.0-16.4, or 17.0-17.0
-
Identify tables with row-level security enabledQuery pg_tables with: SELECT schemaname, tablename FROM pg_tables WHERE schemaname NOT IN ('pg_catalog', 'information_schema') AND EXISTS (SELECT 1 FROM pg_policies WHERE pg_policies.tablename = pg_tables.tablename);Affected if Row-level security policies exist on any tables in the database
-
Check for security definer functionsQuery pg_proc: SELECT proname, prosrc FROM pg_proc WHERE proisstrict = false AND prosrc LIKE '%<table_name>%'; or review functions with SECURITY DEFINER attribute via: SELECT proname, prosrc FROM pg_proc WHERE proisstrict = false;Affected if Security definer functions exist that reference tables with RLS policies
-
Check for views with security_invoker attributeQuery pg_views: SELECT schemaname, viewname FROM pg_views WHERE security_invoker = true;Affected if Security invoker views are present in the database
-
Review SET ROLE usage patternsAudit application code and database session configurations for SET ROLE, SET SESSION AUTHORIZATION, or ALTER ROLE ... SET ROLE statements that may switch between roles within the same sessionAffected if The application or database uses SET ROLE operations that could cause a query planned under one role to execute under a different role
You are affected if your PostgreSQL version is vulnerable AND you use row-level security policies combined with security definer functions, security invoker views, or SET ROLE operations that switch execution contexts.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped12.2113.1714.14
Upgrade PostgreSQL to version 17.1, 16.5, 15.9, 14.14, 13.17, or 12.21 or later. Review existing row security policies and applications using SET ROLE or security definer functions to verify correct behavior after patching.
Upgrade to PostgreSQL 12.21, 13.17, 14.14, 15.9, 16.5, or 17.1+ (matching your current major version)
- 1. Identify the current PostgreSQL version by running: psql --version or SELECT version();
- 2. Identify the operating system and package manager (e.g., yum/apt for Linux, Docker, or homebrew)
- 3. For yum/rpm-based systems (RHEL, CentOS, Fedora): Run 'sudo yum update postgresql' or 'sudo dnf update postgresql'
- 4. For apt/deb-based systems (Debian, Ubuntu): Run 'sudo apt update' followed by 'sudo apt install postgresql'
- 5. For Docker: Pull the fixed image (e.g., postgres:15.9, postgres:14.14, postgres:13.17, postgres:12.21) and recreate the container with the same volume data
- 6. For Homebrew: Run 'brew update' then 'brew upgrade postgresql'
- 7. After upgrading, verify the new version with 'psql --version' to confirm it matches a fixed release (12.21, 13.17, 14.14, 15.9, 16.5, or 17.1+)
- 8. Test application functionality to ensure row security policies work correctly with the upgrade
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation3.0 h
- Implementation4.0 h
- Testing8.0 h
- Review / QA3.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,896.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2024-10976 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2024-10976 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data