Re: CREATE ROLE IF NOT EXISTS

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CREATE ROLE IF NOT EXISTS
Дата
Msg-id 264986.1635977880@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: CREATE ROLE IF NOT EXISTS  (David Christensen <david.christensen@crunchydata.com>)
Ответы Re: CREATE ROLE IF NOT EXISTS  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
David Christensen <david.christensen@crunchydata.com> writes:
> Updated version attached.

I'm generally pretty down on IF NOT EXISTS semantics in all cases,
but it seems particularly dangerous for something as fundamental
to privilege checks as a role.  It's not hard at all to conjure up
scenarios in which this permits privilege escalation.  That is,
Alice wants to create role Bob and give it some privileges, but
she's lazy and writes a quick-and-dirty script using CREATE ROLE
IF NOT EXISTS.  Meanwhile Charlie sneaks in and creates Bob first,
and then grants it to himself.  Now Alice's script is giving away
all sorts of privilege to Charlie.  (Admittedly, Charlie must have
CREATEROLE privilege already, but that doesn't mean he has every
privilege that Alice has --- especially not as we continue working
to slice the superuser salami ever more finely.)

Do we really need this?

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Smith
Дата:
Сообщение: Re: row filtering for logical replication
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: extended stats on partitioned tables