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:58 +0000
Message-ID: <E1xQQFy-000000003dR-3Xa0@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_18_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/7f30f607a2579ea90c0d3ca2739a4a83eb7316ed
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(-)
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: <E1xQQFy-000000003dR-3Xa0@gemulon.postgresql.org>
References: <E1xQQFy-000000003dR-3Xa0@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