Re: Identifying user-created objects

Поиск
Список
Период
Сортировка
От Masahiko Sawada
Тема Re: Identifying user-created objects
Дата
Msg-id CA+fd4k5EiNbqWaBRxdKjdjUPAGU3cYh-khxYso1J3Fc9rJvfcQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Identifying user-created objects  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Ответы Re: Identifying user-created objects  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Список pgsql-hackers
On Wed, 4 Mar 2020 at 16:43, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
>
>
>
> On 2020/02/05 20:26, Masahiko Sawada wrote:
> > Hi,
> >
> > User can create database objects such as functions into pg_catalog.
> > But if I'm not missing something, currently there is no
> > straightforward way to identify if the object is a user created object
> > or a system object which is created during initdb. If we can do that
> > user will be able to check if malicious functions are not created in
> > the database, which is important from the security perspective.
>
> The function that you are proposing is really enough for this use case?
> What if malicious users directly change the oid of function
> to < FirstNormalObjectId? Or you're assuming that malicious users will
> never log in as superuser and not be able to change the oid?

That's a good point! I'm surprised that user is allowed to update an
oid of database object. In addition, surprisingly we can update it to
0, which in turn leads the assertion failure:

TRAP: BadArgument("OidIsValid(relid)", File: "autovacuum.c", Line: 2990)

As you pointed out, it's not enough as long as users can manually
update oid to < FirstNormalObjectId. But I wonder if we should rather
forbid that.

Regards,

--
Masahiko Sawada            http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: PG_COLOR not mentioned in docs of vacuumlo, oid2name and pgbench
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: reindex concurrently and two toast indexes