pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Check table ownership when DROP OWNED BY changes policies.
Date: Mon, 09 Nov 2026 14:21:53 +0000
Message-ID: <E1xQQFt-000000003SQ-3V90@gemulon.postgresql.org> (raw)

Check table ownership when DROP OWNED BY changes policies.

DROP OWNED BY removes the given roles from any row-level security
policies that apply to them, but it does not check that the current
user owns the table.  This allows a role to remove itself from
restrictive policies on tables it does not own.  To fix, leave such
policies unchanged and issue a warning, as is already done for
privileges that the current user cannot revoke.

Reported-by: Zsolt Parragi <zsolt.parragi@percona.com>
Reported-by: Anthropic OSS program
Author: Zsolt Parragi <zsolt.parragi@percona.com>
Co-authored-by: Anthropic OSS program
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Sami Imseih <samimseih.pg@gmail.com>
Security: CVE-2026-116311
Backpatch-through: 14

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c98434b85018e05b767dda23b538bb5b7fbe1cc9
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
src/backend/catalog/pg_shdepend.c         |  4 ++--
src/backend/commands/policy.c             | 21 +++++++++++++++++++++
src/test/regress/expected/rowsecurity.out |  7 +++++++
src/test/regress/sql/rowsecurity.sql      |  7 +++++++
4 files changed, 37 insertions(+), 2 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1xQQFt-000000003SQ-3V90@gemulon.postgresql.org>
Permalink:  ../E1xQQFt-000000003SQ-3V90@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xQQFt-000000003SQ-3V90@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com
  Subject: Re: pgsql: Check table ownership when DROP OWNED BY changes policies.
  In-Reply-To: <E1xQQFt-000000003SQ-3V90@gemulon.postgresql.org>
  References: <E1xQQFt-000000003SQ-3V90@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox