Re: postgres_fdw super user checks

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: postgres_fdw super user checks
Date: 2016-10-17 06:18:23
Message-ID: CAB7nPqQcb6C_3rCn1-p89-ruVXxr8=LW-eP6pxHxskuah0mTog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 17, 2016 at 3:33 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> postgres_fdw has some checks to enforce that non-superusers must connect to
> the foreign server with a password-based method. The reason for this is to
> prevent the authentication to the foreign server from happening on the basis
> of the OS user who is running the non-foreign server.
>
> But I think these super user checks should be run against the userid of the
> USER MAPPING being used for the connection, not the userid of currently
> logged on user.

So, if the user mapping user is a superuser locally, this would allow
any lambda user of the local server to attempt a connection to the
remote server. It looks dangerous rather dangerous to me to authorize
that, even if the current behavior is a bit inconsistent I agree.

Your patch breaks the join pushdown logic when multiple user IDs are
involved. Per se make check.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message 서정협 2016-10-17 06:26:28 When is TopMemoryContext released ?
Previous Message Michael Paquier 2016-10-17 05:37:05 Re: pg_basebackup stream xlog to tar