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 <[email protected]> Reported-by: Anthropic OSS program Author: Zsolt Parragi <[email protected]> Co-authored-by: Anthropic OSS program Reviewed-by: Nathan Bossart <[email protected]> Reviewed-by: Sami Imseih <[email protected]> Security: CVE-2026-116311 Backpatch-through: 14 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/c98434b85018e05b767dda23b538bb5b7fbe1cc9 Author: Nathan Bossart <[email protected]> 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(-)
