Re: pg_amcheck option to install extension - Mailing list pgsql-hackers

From Mark Dilger
Subject Re: pg_amcheck option to install extension
Date
Msg-id FF80A50B-96BE-457F-B115-D65FF50CE50E@enterprisedb.com
Whole thread Raw
In response to Re: pg_amcheck option to install extension  (Michael Paquier <michael@paquier.xyz>)
Responses Re: pg_amcheck option to install extension  (Michael Paquier <michael@paquier.xyz>)
Re: pg_amcheck option to install extension  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers

> On Apr 19, 2021, at 9:22 PM, Michael Paquier <michael@paquier.xyz> wrote:
>
> On Mon, Apr 19, 2021 at 08:39:06PM -0700, Mark Dilger wrote:
>> This is a classic privilege escalation attack.  Bob has one
>> privilege, and uses it to get another.
>
> Bob is a superuser, so it has all the privileges of the world for this
> instance.  In what is that different from BASE_BACKUP or just COPY
> FROM PROGRAM?

I think you are conflating the concept of an operating system adminstrator with the concept of the database
superuser/owner. If the operating system user that postgres is running as cannot execute any binaries, then "copy from
program"is not a way for a database admistrator to escape the jail.  If Bob does not have ssh access to the system, he
cannotrun pg_basebackup.  

> I am not following your argument here.

The argument is that the operating system user that postgres is running as, perhaps user "postgres", can read the files
inthe $PGDATA directory, but Bob can only see the MVCC view of the data, not the raw data.  Installing contrib/amcheck
allowsBob to get a peak behind the curtain. 

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Table refer leak in logical replication
Next
From: Andy Fan
Date:
Subject: Re: 2 questions about volatile attribute of pg_proc.