Обсуждение: pageinspect some function no need superuser priv

Поиск
Список
Период
Сортировка

pageinspect some function no need superuser priv

От
jian he
Дата:
hi.

just came to my mind.

If you're the table owner, you should be allowed to use get_raw_page (and other
pageinspect module functions)?
We can use RangeVarGetRelidExtended with
RangeVarCallbackOwnsRelation to perform the ownership check.

Attached is a draft POC.
Am I missing anything obvious?

Вложения

Re: pageinspect some function no need superuser priv

От
Kirill Reshke
Дата:


On Tue, 14 Oct 2025, 18:27 jian he, <jian.universality@gmail.com> wrote:
hi.

just came to my mind.

If you're the table owner, you should be allowed to use get_raw_page (and other
pageinspect module functions)?
We can use RangeVarGetRelidExtended with
RangeVarCallbackOwnsRelation to perform the ownership check.

Attached is a draft POC.
Am I missing anything obvious?

Hi!
I was also wondering if there is any security vulnerability with that. 
I was thinking about page lsn, checkpoint and wal compression as a possible way to abuse, but did not managed to came up with exploit

Re: pageinspect some function no need superuser priv

От
Tom Lane
Дата:
Kirill Reshke <reshkekirill@gmail.com> writes:
> On Tue, 14 Oct 2025, 18:27 jian he, <jian.universality@gmail.com> wrote:
>> If you're the table owner, you should be allowed to use get_raw_page (and
>> other pageinspect module functions)?

> I was also wondering if there is any security vulnerability with that.
> I was thinking about page lsn, checkpoint and wal compression as a possible
> way to abuse, but did not managed to came up with exploit

Yeah, I do not think it follows that being table owner should
entitle you to such low-level access.  I'm inclined to reject
this proposal.

            regards, tom lane



Re: pageinspect some function no need superuser priv

От
Nathan Bossart
Дата:
On Tue, Oct 14, 2025 at 10:29:39AM -0400, Tom Lane wrote:
> Yeah, I do not think it follows that being table owner should
> entitle you to such low-level access.  I'm inclined to reject
> this proposal.

-1 here, too.  IMHO all of pageinspect should remain superuser-only since
it is meant for development/debugging.  The proposal doesn't describe a
use-case for the relaxed privileges, either.

-- 
nathan



Re: pageinspect some function no need superuser priv

От
Michael Paquier
Дата:
On Tue, Oct 14, 2025 at 10:51:51AM -0500, Nathan Bossart wrote:
> On Tue, Oct 14, 2025 at 10:29:39AM -0400, Tom Lane wrote:
>> Yeah, I do not think it follows that being table owner should
>> entitle you to such low-level access.  I'm inclined to reject
>> this proposal.
>
> -1 here, too.  IMHO all of pageinspect should remain superuser-only since
> it is meant for development/debugging.  The proposal doesn't describe a
> use-case for the relaxed privileges, either.

Same.  We've always wanted this module to be superuser-only, with
superuser hardcoded checks and not even execution ACLs.
--
Michael

Вложения